com.adventnet.tl1.message
Class TL1Time

java.lang.Object
  extended by com.adventnet.tl1.message.TL1Time

public class TL1Time
extends java.lang.Object

This class represents the time as hour-min-sec format. This class is used in TL1Header class which is part of the Output (Response and Autonomous) Messages and represent the time when the message was generated. This object is also used in the General Block of the Input Message.

See Also:
TL1Header, TL1GeneralBlock

Constructor Summary
TL1Time()
          Default constructor that creates an instance of the TL1Time object.
TL1Time(int hour, int min, int sec)
          Constructor that creates an instance of the TL1Time object and initialises the hour, minute, sec parameters with the given values.
 
Method Summary
 boolean equals(TL1Time time)
          Checks whether the given Time object values is equal to this object values are equal.
 int getHour()
          Gets the hour value set in this object.
 int getMinute()
          Gets the minute value set in this object.
 int getSecond()
          Gets the second value set in this object.
 byte getTL1MessageType()
          Get the TL1 Message Type set on this object.
 void setHour(int hour)
          Sets the hour field in this object.
 void setMinute(int min)
          Sets the minute field in this object.
 void setSecond(int sec)
          Sets the second field in this object.
 void setTL1MessageType(byte messageType)
          Sets the TL1 Message Type set on this object.
 java.lang.String toString()
          Returns the stringified form of this TL1Time object.
 java.lang.String toString(byte messageType)
          Deprecated. Since AdventNetTL1 API 2.0. Use toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TL1Time

public TL1Time()
Default constructor that creates an instance of the TL1Time object.


TL1Time

public TL1Time(int hour,
               int min,
               int sec)
Constructor that creates an instance of the TL1Time object and initialises the hour, minute, sec parameters with the given values.

Parameters:
hour - integer representing hour value.
min - integer representing minute value.
sec - integer representing second value.
Method Detail

setHour

public void setHour(int hour)
Sets the hour field in this object.

Parameters:
hour - The hour value to set.

getHour

public int getHour()
Gets the hour value set in this object.

Returns:
The hour value set on this object.

setMinute

public void setMinute(int min)
Sets the minute field in this object.

Parameters:
min - The minute value to set.

getMinute

public int getMinute()
Gets the minute value set in this object.

Returns:
The minute value set on this object.

setSecond

public void setSecond(int sec)
Sets the second field in this object.

Parameters:
sec - The second value to set.

getSecond

public int getSecond()
Gets the second value set in this object.

Returns:
The second value set on this object.

setTL1MessageType

public void setTL1MessageType(byte messageType)
Sets the TL1 Message Type set on this object.

Parameters:
messageType - The TL1 Message type. This can be one of
TL1API.INPUT_MESSAGE, TL1API.RESPONSE_MESSAGE, TL1API.AUTONOMOUS_MESSAGE

getTL1MessageType

public byte getTL1MessageType()
Get the TL1 Message Type set on this object.

Returns:
The Message type set on this object. This can be one of
TL1API.INPUT_MESSAGE, TL1API.RESPONSE_MESSAGE, TL1API.AUTONOMOUS_MESSAGE

equals

public boolean equals(TL1Time time)
Checks whether the given Time object values is equal to this object values are equal.

Parameters:
time - TL1Time object to compare.
Returns:
true - if equal ,
false otherwise

toString

public java.lang.String toString()
Returns the stringified form of this TL1Time object.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this object.

toString

public java.lang.String toString(byte messageType)
Deprecated. Since AdventNetTL1 API 2.0. Use toString()

See Also:
toString()