cl::utfsm::samplingSystemUI::core::SampDetail Class Reference

Collaboration diagram for cl::utfsm::samplingSystemUI::core::SampDetail:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SampDetail (String component, String property, long frequency, long reportRate)
String getComponent ()
String getProperty ()
long getFrequency ()
long getReportRate ()
boolean equals (Object anObject)
int hashCode ()

Package Attributes

String component = ""

Properties

 String = ""
long frequency
long reportRate
int hashcode = 0

Private Member Functions

void rehash ()

Detailed Description

Class SampDetail hold the detail for a sampling order. Each one of this objects should be unique. Two of theese objects are considered equals if their component, property, frequency and reportRate are equals. For this reason the equals meber had to be overloaded. The hashcode member was also overloaded. This class has no seter members, for that reason values may only be set upon creation, this is a failsafe so you don't accidentaly modify the values once sampling has began. As values can only be set at creation, the hashcode is computed only once, at creation. If later on this class is modified to allow seters this behavior must be kept in mind, and be modified.


Constructor & Destructor Documentation

cl::utfsm::samplingSystemUI::core::SampDetail::SampDetail ( String  component,
String  property,
long  frequency,
long  reportRate 
) [inline]

References rehash().


Member Function Documentation

boolean cl::utfsm::samplingSystemUI::core::SampDetail::equals ( Object  anObject  )  [inline]

compare with an object and see if they are equal. This is an overloaded version of Object.equals(), this meber returns true if anObject is of class SampDetail, and if all attributes are the same.

Parameters:
anObject object type to which to compare to.
Returns:
true or false.

References component, frequency, getComponent(), getFrequency(), getProperty(), getReportRate(), and reportRate.

String cl::utfsm::samplingSystemUI::core::SampDetail::getComponent (  )  [inline]
long cl::utfsm::samplingSystemUI::core::SampDetail::getFrequency (  )  [inline]
String cl::utfsm::samplingSystemUI::core::SampDetail::getProperty (  )  [inline]
long cl::utfsm::samplingSystemUI::core::SampDetail::getReportRate (  )  [inline]
int cl::utfsm::samplingSystemUI::core::SampDetail::hashCode (  )  [inline]

Return de overloaded version of hashCode. This version return the value of hashcode computed by rehash().

Returns:
int has value

References hashcode.

Referenced by cl::utfsm::samplingSystemUITestCase::SampDetailTest::testEquals().

void cl::utfsm::samplingSystemUI::core::SampDetail::rehash (  )  [inline, private]

Hashing funtion. This function computes the hashcode that is returned by invocations of hashCode() member. Since the contract of a Hash Code function is demanding, this function makes use of the hashing function of a tested class. The hashing is done by concatenating the name of the component, property, frequency and reportRate into a String and then calculating the hascode of such string. This ensures us a unique hashcode and a uniformly distributed.

hash is calculated over: 'COMPONET_PROPERTY_FREQUENCY_REPORTRATE'

See also:
String

References component, frequency, hashcode, reportRate, and String.

Referenced by SampDetail().


Member Data Documentation

Referenced by equals(), getComponent(), and rehash().


Property Documentation

long cl::utfsm::samplingSystemUI::core::SampDetail::frequency [package]

Referenced by equals(), getFrequency(), and rehash().

int cl::utfsm::samplingSystemUI::core::SampDetail::hashcode = 0 [package]

Referenced by hashCode(), and rehash().

long cl::utfsm::samplingSystemUI::core::SampDetail::reportRate [package]

Referenced by equals(), getReportRate(), and rehash().

cl::utfsm::samplingSystemUI::core::SampDetail::String = "" [package]

Referenced by rehash().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2