Class TimeStampedObject<C>

java.lang.Object
org.opentrafficsim.base.TimeStampedObject<C>
Type Parameters:
C - the time stamped object class.
All Implemented Interfaces:
Serializable

public class TimeStampedObject<C> extends Object implements Serializable
An object with a time stamp, where the object is of a specific class.

Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers
See Also:
  • Constructor Details

    • TimeStampedObject

      public TimeStampedObject(C object, Time timestamp)
      Construct a new TimeStampedObject.
      Parameters:
      object - C; the object.
      timestamp - Time; the time stamp.
  • Method Details

    • getObject

      public final C getObject()
      Retrieve the object.
      Returns:
      C; the object
    • getTimestamp

      public final Time getTimestamp()
      Retrieve the time stamp.
      Returns:
      Time; the time stamp
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object