pRTI™ v1.3

se.pitch.prti
Class LogicalTimeDouble

java.lang.Object
  |
  +--se.pitch.prti.LogicalTimeDouble

public class LogicalTimeDouble
extends java.lang.Object
implements LogicalTime, java.io.Serializable

Implementation of Logical Time. Time is represented by a double.

See Also:
Serialized Form

Constructor Summary
LogicalTimeDouble(double value)
          Constructs and initates a Logical Time.
LogicalTimeDouble(LogicalTimeDouble other)
          Constructs and initates a Logical Time from another LogicalTimeDouble.
LogicalTimeDouble(java.lang.String s)
          Constructs and initates a Logical Time.
 
Method Summary
 void decreaseBy(LogicalTimeInterval subtrahend)
          Decreses logical time by the specified interval.
 void encode(byte[] buffer, int offset)
          Encodes the logical time to a transportable format.
 int encodedLength()
          Returns the length of the encoded logical time.
 double getValue()
          Return the logical time as a double.
 void increaseBy(LogicalTimeInterval addend)
          Increses the logical time by the specified interval.
 boolean isEqualTo(LogicalTime value)
          Checks if times are equal.
 boolean isFinal()
          Checks if the value of time is final (greatest time possible).
 boolean isGreaterThan(LogicalTime value)
          Compares if the time is greater than another time.
 boolean isGreaterThanOrEqualTo(LogicalTime value)
          Compares if the time is greater than or equal to another time.
 boolean isInitial()
          Check if the value of time is initial (lowest time possible).
 boolean isLessThan(LogicalTime value)
          Compares if the time is less than another time.
 boolean isLessThanOrEqualTo(LogicalTime value)
          Compares if the time is less than or equal to another time.
 void setFinal()
          Sets the time to the greatest time possible.
 void setInitial()
          Sets the time to the lowest time possible.
 void setTo(LogicalTime value)
          Sets the time to a specified Logical Time.
 LogicalTimeInterval subtract(LogicalTime subtrahend)
          Decreses logical time by the specified logical time.
 java.lang.String toString()
          Return a string representation of the logical time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogicalTimeDouble

public LogicalTimeDouble(double value)
                  throws hla.rti.InvalidFederationTime
Constructs and initates a Logical Time.
Parameters:
value - The initial time as a double

LogicalTimeDouble

public LogicalTimeDouble(java.lang.String s)
                  throws hla.rti.InvalidFederationTime
Constructs and initates a Logical Time.
Parameters:
s - The initial time encoded in a string.

LogicalTimeDouble

public LogicalTimeDouble(LogicalTimeDouble other)
Constructs and initates a Logical Time from another LogicalTimeDouble.
Parameters:
other - Initial time from another Logical Time Double.
Method Detail

getValue

public double getValue()
Return the logical time as a double.
Returns:
The value.

increaseBy

public void increaseBy(LogicalTimeInterval addend)
Description copied from interface: LogicalTime
Increses the logical time by the specified interval.
Specified by:
increaseBy in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
addend - Logical Time Interval

isEqualTo

public boolean isEqualTo(LogicalTime value)
Description copied from interface: LogicalTime
Checks if times are equal.
Specified by:
isEqualTo in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
value - Time to compare with.
Returns:
True if equal, false if not.

isInitial

public boolean isInitial()
Description copied from interface: LogicalTime
Check if the value of time is initial (lowest time possible).
Specified by:
isInitial in interface LogicalTime
Tags copied from interface: LogicalTime
Returns:
True if time is initial, false otherwise.

isGreaterThan

public boolean isGreaterThan(LogicalTime value)
Description copied from interface: LogicalTime
Compares if the time is greater than another time.
Specified by:
isGreaterThan in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
value - The logical time to compare with.
Returns:
True if time is greater than the supplied time. False if not.

encode

public void encode(byte[] buffer,
                   int offset)
Description copied from interface: LogicalTime
Encodes the logical time to a transportable format.
Specified by:
encode in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
buffer - The resulting byte array buffer
offset - Start position in the destination data

decreaseBy

public void decreaseBy(LogicalTimeInterval subtrahend)
                throws hla.rti.IllegalTimeArithmetic
Description copied from interface: LogicalTime
Decreses logical time by the specified interval.
Specified by:
decreaseBy in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
subtrahend - Logical time interval

isGreaterThanOrEqualTo

public boolean isGreaterThanOrEqualTo(LogicalTime value)
Description copied from interface: LogicalTime
Compares if the time is greater than or equal to another time.
Specified by:
isGreaterThanOrEqualTo in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
value - The logical time to compare with.
Returns:
True if time is greater than or qeual to the supplied time. False if not.

setTo

public void setTo(LogicalTime value)
Description copied from interface: LogicalTime
Sets the time to a specified Logical Time.
Specified by:
setTo in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
value - Logical Time

isLessThan

public boolean isLessThan(LogicalTime value)
Description copied from interface: LogicalTime
Compares if the time is less than another time.
Specified by:
isLessThan in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
value - The logical time to compare with.
Returns:
True if time is less than the supplied time. False if not.

setFinal

public void setFinal()
Description copied from interface: LogicalTime
Sets the time to the greatest time possible.
Specified by:
setFinal in interface LogicalTime

encodedLength

public int encodedLength()
Description copied from interface: LogicalTime
Returns the length of the encoded logical time.
Specified by:
encodedLength in interface LogicalTime
Tags copied from interface: LogicalTime
Returns:
Length of encoded time.

isLessThanOrEqualTo

public boolean isLessThanOrEqualTo(LogicalTime value)
Description copied from interface: LogicalTime
Compares if the time is less than or equal to another time.
Specified by:
isLessThanOrEqualTo in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
value - The logical time to compare with.
Returns:
True if time is less than or qeual to the supplied time. False if not.

isFinal

public boolean isFinal()
Description copied from interface: LogicalTime
Checks if the value of time is final (greatest time possible).
Specified by:
isFinal in interface LogicalTime
Tags copied from interface: LogicalTime
Returns:
True if final, false if not.

setInitial

public void setInitial()
Description copied from interface: LogicalTime
Sets the time to the lowest time possible.
Specified by:
setInitial in interface LogicalTime

subtract

public LogicalTimeInterval subtract(LogicalTime subtrahend)
Description copied from interface: LogicalTime
Decreses logical time by the specified logical time.
Specified by:
subtract in interface LogicalTime
Tags copied from interface: LogicalTime
Parameters:
subtrahend - Logical time

toString

public java.lang.String toString()
Return a string representation of the logical time.
Overrides:
toString in class java.lang.Object
Returns:
String.

pRTI™ v1.3

Visit the pRTI™ Website

pRTI is a trademark of Pitch Technologies AB

Repslagaregatan 25
S-582 22 Linkoping,
Sweden.
All Rights Reserved.