com.isti.trinetwatch.station
Class StationLevelsEntry

java.lang.Object
  extended by com.isti.trinetwatch.station.StationLevelsEntry
All Implemented Interfaces:
java.lang.Comparable

public class StationLevelsEntry
extends java.lang.Object
implements java.lang.Comparable

Class StationLevelsEntry contains a status and usage level for a station at a given time.


Field Summary
 short statusLevelIndex
           
 int timeValue
           
 short usageLevelIndex
           
 
Constructor Summary
StationLevelsEntry(int timeVal, StatusLevelTag sLevelObj, UsageLevelTag uLevelObj)
          Creates a station-levels entry object.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.lang.String toString()
          Returns a string displaying the values held by this entry object.
 boolean valuesEquals(int timeVal, StatusLevelTag sLevelObj, UsageLevelTag uLevelObj)
          Indicates if the given values are equal to the values held by this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timeValue

public final int timeValue

statusLevelIndex

public final short statusLevelIndex

usageLevelIndex

public final short usageLevelIndex
Constructor Detail

StationLevelsEntry

public StationLevelsEntry(int timeVal,
                          StatusLevelTag sLevelObj,
                          UsageLevelTag uLevelObj)
                   throws java.lang.IllegalArgumentException
Creates a station-levels entry object.

Parameters:
timeVal - time value associated with levels.
sLevelObj - status-level object, or null for none.
uLevelObj - usage-level object, or null for none.
Throws:
java.lang.IllegalArgumentException - if index value for given status or usage level is out of range.
Method Detail

compareTo

public int compareTo(java.lang.Object obj)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The time value is used for the comparison.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the Object to be compared.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. The time value is used for the comparison.

Overrides:
equals in class java.lang.Object
Parameters:
obj - reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

valuesEquals

public boolean valuesEquals(int timeVal,
                            StatusLevelTag sLevelObj,
                            UsageLevelTag uLevelObj)
Indicates if the given values are equal to the values held by this object.

Parameters:
timeVal - time value associated with levels.
sLevelObj - status-level object.
uLevelObj - usage-level object.
Returns:
true if the given values are equal to the values held by this object; false if not.

toString

public java.lang.String toString()
Returns a string displaying the values held by this entry object.

Overrides:
toString in class java.lang.Object
Returns:
A string displaying the values held by this entry object.