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 Type
    Method
    Description
    add(U val)
    Returns a LogicalTime whose value is (this + val).
    int
    compareTo(T other)
    Compares this object with the specified object for order.
    distance(T val)
    Returns a LogicalTimeInterval whose value is the time interval between this and val.
    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 logical time Supports standard Java mechanisms.
    int
    Two LogicalTimes for which equals() is true should yield same hash code
    boolean
    Returns true is this time is equal to the final time.
    boolean
    Returns true is this time is equal to the initial time.
    subtract(U val)
    Returns a LogicalTime whose value is (this - val).
     
  • 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:
      IllegalTimeArithmetic
      InvalidLogicalTimeInterval
    • 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:
      IllegalTimeArithmetic
      InvalidLogicalTimeInterval
    • distance

      U distance(T val) throws InvalidLogicalTime
      Returns a LogicalTimeInterval whose value is the time interval between this and val.
      Parameters:
      val - other time.
      Returns:
      distance between times.
      Throws:
      InvalidLogicalTime
    • compareTo

      int compareTo(T 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<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

      boolean equals(Object other)
      Returns true iff this and other represent the same logical time Supports standard Java mechanisms.
      Overrides:
      equals in class Object
    • hashCode

      int hashCode()
      Two LogicalTimes 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