Module hla.rti1516e
Package hla.rti1516e
Interface LogicalTime<T extends LogicalTime<T,U>,U extends LogicalTimeInterval<U>>
- All Superinterfaces:
Comparable<T>,Serializable
- All Known Subinterfaces:
HLAfloat64Time,HLAinteger64Time
public interface LogicalTime<T extends LogicalTime<T,U>,U extends LogicalTimeInterval<U>>
extends Comparable<T>, Serializable
LogicalTime declares an interface to an immutable time value
-
Method Summary
Modifier and TypeMethodDescriptionReturns a LogicalTime whose value is (this + val).intCompares this object with the specified object for order.Returns a LogicalTimeInterval whose value is the time interval between this and val.voidencode(byte[] buffer, int offset) Encodes this object in the specified buffer starting at the specified offset.intReturns the size of the buffer required to encode this object.booleanReturns true iff this and other represent the same logical time Supports standard Java mechanisms.inthashCode()Two LogicalTimes for which equals() is true should yield same hash codebooleanisFinal()Returns true is this time is equal to the final time.booleanReturns true is this time is equal to the initial time.Returns a LogicalTime whose value is (this - val).toString()
-
Method Details
-
isInitial
boolean isInitial()Returns true is this time is equal to the initial time.- Returns:
- true if initial value.
-
isFinal
boolean isFinal()Returns true is this time is equal to the final time.- Returns:
- true if final value.
-
add
Returns a LogicalTime whose value is (this + val). The returned value shall be different from this value if the specified interval != 0.- Parameters:
val- interval to add.- Returns:
- new time value.
- Throws:
IllegalTimeArithmeticInvalidLogicalTimeInterval
-
subtract
Returns a LogicalTime whose value is (this - val). The returned value shall be different from this value if the specified interval != 0.- Parameters:
val- interval to subtract.- Returns:
- new time value.
- Throws:
IllegalTimeArithmeticInvalidLogicalTimeInterval
-
distance
Returns a LogicalTimeInterval whose value is the time interval between this and val.- Parameters:
val- other time.- Returns:
- distance between times.
- Throws:
InvalidLogicalTime
-
compareTo
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.- Specified by:
compareToin interfaceComparable<T extends LogicalTime<T,U>> - Parameters:
other- 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.
-
equals
Returns true iff this and other represent the same logical time Supports standard Java mechanisms. -
hashCode
int hashCode()Two LogicalTimes for which equals() is true should yield same hash code -
toString
String toString() -
encodedLength
int encodedLength()Returns the size of the buffer required to encode this object.- Returns:
- size of buffer.
-
encode
Encodes this object in the specified buffer starting at the specified offset.- Parameters:
buffer- the buffer to encode into.offset- the offset where to start encoding.- Throws:
CouldNotEncode
-