pRTI™ v1.3

se.pitch.prti
Class LogicalTimeIntervalDouble

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

public class LogicalTimeIntervalDouble
extends java.lang.Object
implements LogicalTimeInterval, java.io.Serializable

Implementation of LogicalTimeInterval. Represents time intervals using double.

See Also:
Serialized Form

Constructor Summary
LogicalTimeIntervalDouble(double value)
          Constructs a LogicalTimeIntervalDouble.
LogicalTimeIntervalDouble(LogicalTimeIntervalDouble other)
          Constructs a LogicalTimeIntervalDouble.
LogicalTimeIntervalDouble(java.lang.String s)
          Constructs a LogicalTimeIntervalDouble.
 
Method Summary
 void encode(byte[] buffer, int offset)
          Encodes the logical time interval to a transportable format.
 int encodedLength()
          Returns the length of the encoded logical time interval.
 double getValue()
          Return the Logical Time Interval as a double.
 boolean isEpsilon()
          Check is time interval is epsilon
 boolean isEqualTo(LogicalTimeInterval value)
          Checks if times interval are equal in length.
 boolean isFinal()
          Check if the value of the Logical Time Interval is the maximum possible value.
 boolean isGreaterThan(LogicalTimeInterval value)
          Compares if the interval is longer than another interval.
 boolean isGreaterThanOrEqualTo(LogicalTimeInterval value)
          Compares if the interval is longer or equal to to another interval.
 boolean isLessThan(LogicalTimeInterval value)
          Compares if the interval is shorter than another interval.
 boolean isLessThanOrEqualTo(LogicalTimeInterval value)
          Compares if the interval is shorter or equal to to another interval.
 boolean isZero()
          Check is the interval is zero.
 void setEpsilon()
          Sets the interval to epsilon.
 void setTo(LogicalTimeInterval value)
          Sets the interval to the specified length.
 void setZero()
          Sets the interval to zero.
 java.lang.String toString()
          String representation of Logical Time Interval Double.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogicalTimeIntervalDouble

public LogicalTimeIntervalDouble(double value)
                          throws hla.rti.InvalidLookahead
Constructs a LogicalTimeIntervalDouble.
Parameters:
value - Inital double interval value.

LogicalTimeIntervalDouble

public LogicalTimeIntervalDouble(java.lang.String s)
                          throws hla.rti.InvalidLookahead
Constructs a LogicalTimeIntervalDouble.
Parameters:
value - Inital interval value encoded in a string.

LogicalTimeIntervalDouble

public LogicalTimeIntervalDouble(LogicalTimeIntervalDouble other)
Constructs a LogicalTimeIntervalDouble.
Parameters:
other - Inital interval value from another LogicalTimeIntervalDouble.
Method Detail

getValue

public double getValue()
Return the Logical Time Interval as a double.
Returns:
The interval

isEpsilon

public boolean isEpsilon()
Description copied from interface: LogicalTimeInterval
Check is time interval is epsilon
Specified by:
isEpsilon in interface LogicalTimeInterval
Tags copied from interface: LogicalTimeInterval
Returns:
True if the interval is epsilon, false otherwise.

isFinal

public boolean isFinal()
Check if the value of the Logical Time Interval is the maximum possible value.
Returns:
True if the interval is final, fasle if not.

isEqualTo

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

isGreaterThan

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

encode

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

isGreaterThanOrEqualTo

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

setTo

public void setTo(LogicalTimeInterval value)
Description copied from interface: LogicalTimeInterval
Sets the interval to the specified length.
Specified by:
setTo in interface LogicalTimeInterval
Tags copied from interface: LogicalTimeInterval
Parameters:
value - Logical Time Interval

isLessThan

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

encodedLength

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

setZero

public void setZero()
Description copied from interface: LogicalTimeInterval
Sets the interval to zero.
Specified by:
setZero in interface LogicalTimeInterval

isLessThanOrEqualTo

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

isZero

public boolean isZero()
Description copied from interface: LogicalTimeInterval
Check is the interval is zero.
Specified by:
isZero in interface LogicalTimeInterval
Tags copied from interface: LogicalTimeInterval
Parameters:
value - Logical time interval
Returns:
True if interval is zero, false otherwise.

setEpsilon

public void setEpsilon()
Description copied from interface: LogicalTimeInterval
Sets the interval to epsilon.
Specified by:
setEpsilon in interface LogicalTimeInterval

toString

public java.lang.String toString()
String representation of Logical Time Interval Double.
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.