Package org.djutils.event
Class TimedEvent<T extends Comparable<T>>
java.lang.Object
org.djutils.event.Event
org.djutils.event.TimedEvent<T>
- Type Parameters:
T- the Comparable type that represents time
- All Implemented Interfaces:
Comparable<TimedEvent<T>>
The TimedEvent is the reference implementation for a timed event.
Copyright (c) 2002-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html. This class was originally part of the DSOL project, see https://simulation.tudelft.nl/dsol/manual.
- Author:
- Peter Jacobs , Alexander Verbraeck
-
Constructor Summary
ConstructorsConstructorDescriptionTimedEvent(EventType type, Object content, T timeStamp) Construct a new timed event, where compliance with the metadata is verified.TimedEvent(EventType type, Object content, T timeStamp, boolean verifyMetaData) Construct a new timed event, with a choice to verify compliance with metadata. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(TimedEvent<T> o) booleanReturns the timeStamp of this event.inthashCode()toString()Methods inherited from class org.djutils.event.Event
getContent, getType
-
Constructor Details
-
TimedEvent
Construct a new timed event, where compliance with the metadata is verified.- Parameters:
type- the eventType of the event.content- the content of the event.timeStamp- the timeStamp.
-
TimedEvent
Construct a new timed event, with a choice to verify compliance with metadata.- Parameters:
type- the eventType of the event.content- the content of the event.timeStamp- the timeStamp.verifyMetaData- whether to verify the compliance with metadata or not
-
-
Method Details
-
getTimeStamp
Returns the timeStamp of this event.- Returns:
- the time stamp
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<T extends Comparable<T>>
-
toString
-