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 Type
    Method
    Description
    add(U addend)
    Returns a LogicalTimeInterval whose value is (this + addend).
    int
    compareTo(U other)
    Compares this object with the specified object for order.
    void
    encode(byte[] buffer, int offset)
    Encodes this object in the specified buffer starting at the specified offset.
    int
    Returns the size of the buffer required to encode this object.
    boolean
    equals(Object other)
    Returns true iff this and other represent the same time interval.
    int
    Two LogicalTimeIntervals for which equals() is true should yield same hash code
    boolean
    Returns true is this time is an epsilon interval.
    boolean
    Returns true is this time is a zero interval.
    subtract(U subtrahend)
    Returns a LogicalTimeInterval whose value is (this - subtrahend).
     
  • 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:
      IllegalTimeArithmetic
      InvalidLogicalTimeInterval
    • subtract

      U subtract(U subtrahend) throws IllegalTimeArithmetic, InvalidLogicalTimeInterval
      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:
      IllegalTimeArithmetic
      InvalidLogicalTimeInterval
    • compareTo

      int compareTo(U other)
      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:
      compareTo in interface Comparable<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

      boolean equals(Object other)
      Returns true iff this and other represent the same time interval.
      Overrides:
      equals in class Object
    • hashCode

      int hashCode()
      Two LogicalTimeIntervals for which equals() is true should yield same hash code
      Overrides:
      hashCode in class Object
    • toString

      String toString()
      Overrides:
      toString in class Object
    • encodedLength

      int encodedLength()
      Returns the size of the buffer required to encode this object.
      Returns:
      size of buffer.
    • encode

      void encode(byte[] buffer, int offset) throws CouldNotEncode
      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