T - The type of the user object.public interface SimEvent<T>
SimEventList.
A SimEvent maintains its own scheduled time on a SimEventList,
has a name an an associated SimEventAction, and an optional user object
(for general-purpose use).
The name and the user object are not changed by the jsimulation packages,
and may be null.
If two SimEvents are scheduled on a SimEventList with identical times,
their order of execution is determined by the SimEventList implementation.
In particular, implementations should not assume insertion order of execution for events with identical times
without checking this feature for the particular event list.
The interface, however, mandates that the relative order of execution of simultaneous events
is determined at insertion time,
and not changed thereafter (unless one of the events is rescheduled).
Last javadoc Review: Jan de Jongh, TNO, 20180404, r5.1.0.
| Modifier and Type | Method and Description |
|---|---|
SimEventAction |
getEventAction()
Returns the
SimEventAction associated with this event. |
String |
getName()
Gets the name of this
SimEvent. |
T |
getObject()
Returns the user object associated with this event.
|
long |
getSimEventListDeconflictValue()
Returns the value used for "de-conflicting" simultaneous events on a
SimEventList. |
double |
getTime()
Returns the time at which this
SimEvent is (to be) scheduled on a SimEventList. |
void |
setEventAction(SimEventAction eventAction)
Sets the
SimEventAction associated with this event. |
void |
setName(String name)
Sets the name of this
SimEvent. |
void |
setObject(T object)
Sets the user object associated with this event.
|
void |
setSimEventListDeconflictValue(long simEventListDeconflictValue)
Sets the value used for "de-conflicting" simultaneous events on a
SimEventList. |
void |
setTime(double time)
Sets the time at which this
SimEvent is to be scheduled on a SimEventList. |
String getName()
SimEvent.
The name may be null.
It is not used by the jsimulation package, except for logging purposes.
null).void setName(String name)
SimEvent.
The name may be null.
It is not used by the jsimulation package, except for logging purposes.
name - The new name of the event (may be null).double getTime()
SimEvent is (to be) scheduled on a SimEventList.
The time property should not be changed when the event is currently scheduled on a SimEventList.
SimEvent is (to be) scheduled on a SimEventList.void setTime(double time)
SimEvent is to be scheduled on a SimEventList.
The time property should not be changed when the event is currently scheduled on a SimEventList.
time - The new time at which this SimEvent is to be scheduled on a SimEventList.long getSimEventListDeconflictValue()
SimEventList.
This method is for internal use by a SimEventList.
Implementations must keep a private long (or Long) member to keep the property.
SimEventList.void setSimEventListDeconflictValue(long simEventListDeconflictValue)
SimEventList.
This method is for internal use by a SimEventList.
Implementations must keep a private long (or Long) member to keep the property.
simEventListDeconflictValue - The new value used for "de-conflicting" simultaneous events on a SimEventList.SimEventAction getEventAction()
SimEventAction associated with this event.
The action is invoked when the event is executed on the SimEventList.
The event action (property) should not be changed when the SimEvent is scheduled on
a SimEventList.
SimEventAction (may be null) associated with this event.void setEventAction(SimEventAction eventAction)
SimEventAction associated with this event.
The action is invoked when the event is executed on the SimEventList.
The event action (property) should not be changed when the SimEvent is scheduled on
a SimEventList.
eventAction - The new SimEventAction (may be null) associated with this event.T getObject()
The user object need not be present (may be null and is never used or changed by the
nl.jdj.jsimulation} package.
Also, multiple SimEvents may share a single user object.
Note, however, that the user object (property) should not be changed when the SimEvent is scheduled on
a SimEventList.
void setObject(T object)
The user object need not be present (may be null and is never used or changed
by the jsimulation package.
Also, multiple SimEvents may share a single user object.
Note, however, that the user object (property) should not be changed when the SimEvent is scheduled on
a SimEventList.
object - The new user object (not checked).Copyright © 2018. All rights reserved.