Module hla.rti1516e
Package hla.rti1516e
Interface LogicalTimeInterval<U extends LogicalTimeInterval<U>>
- All Superinterfaces:
Comparable<U>,Serializable
- All Known Subinterfaces:
HLAfloat64Interval,HLAinteger64Interval
public interface LogicalTimeInterval<U extends LogicalTimeInterval<U>>
extends Comparable<U>, Serializable
LogicalTimeInterval declares an interface to an immutable time interval value
-
Method Summary
Modifier and TypeMethodDescriptionReturns a LogicalTimeInterval whose value is (this + addend).intCompares this object with the specified object for order.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 time interval.inthashCode()Two LogicalTimeIntervals for which equals() is true should yield same hash codebooleanReturns true is this time is an epsilon interval.booleanisZero()Returns true is this time is a zero interval.Returns a LogicalTimeInterval whose value is (this - subtrahend).toString()
-
Method Details
-
isZero
boolean isZero()Returns true is this time is a zero interval.- Returns:
- true if zero interval.
-
isEpsilon
boolean isEpsilon()Returns true is this time is an epsilon interval.- Returns:
- true if epsilon.
-
add
Returns a LogicalTimeInterval whose value is (this + addend). The returned value shall be different from this value if the specified addend != 0.- Parameters:
addend- interval to add.- Returns:
- new interval.
- Throws:
IllegalTimeArithmeticInvalidLogicalTimeInterval
-
subtract
Returns a LogicalTimeInterval whose value is (this - subtrahend). The returned value shall be different from this value if the specified subtrahend != 0.- Parameters:
subtrahend- interval to subtract.- Returns:
- new interval.
- Throws:
IllegalTimeArithmeticInvalidLogicalTimeInterval
-
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<U extends LogicalTimeInterval<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 time interval. -
hashCode
int hashCode()Two LogicalTimeIntervals 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
-