T - The type of the user object.public class DefaultSimEvent<T> extends Object implements SimEvent<T>
SimEvent.
A DefaultSimEvent is not thread-safe.
Last javadoc Review: Jan de Jongh, TNO, 20180404, r5.1.0.
SimEvent,
DefaultSimEventComparator| Constructor and Description |
|---|
DefaultSimEvent()
Creates a new
DefaultSimEvent named \"No Name\", time at negative infinity and null object and action. |
DefaultSimEvent(double time)
Creates a new
DefaultSimEvent named \"No Name\", given time and null object and action. |
DefaultSimEvent(double time,
SimEventAction eventAction)
Creates a new
DefaultSimEvent named \"No Name\", given time and action and null object. |
DefaultSimEvent(double time,
T object,
SimEventAction eventAction)
Creates a new
DefaultSimEvent with given parameters and name \"No Name\" (main constructor). |
DefaultSimEvent(String name,
double time,
T object,
SimEventAction eventAction)
Creates a new
DefaultSimEvent with given parameters. |
| 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 |
toString()
Returns the registered name if non-
null, else the super method return value. |
public DefaultSimEvent(String name, double time, T object, SimEventAction eventAction)
DefaultSimEvent with given parameters.name - The name of the event.time - The time at which the event is to be scheduled on a SimEventList.object - The associated user object (may be null).eventAction - The associated event action (may be null).public DefaultSimEvent(double time,
T object,
SimEventAction eventAction)
DefaultSimEvent with given parameters and name \"No Name\" (main constructor).time - The time at which the event is to be scheduled on a SimEventList.object - The associated user object (may be null).eventAction - The associated event action (may be null).public DefaultSimEvent(double time,
SimEventAction eventAction)
DefaultSimEvent named \"No Name\", given time and action and null object.time - The time at which the event is to be scheduled on a SimEventList.eventAction - The associated event action (may be null).public DefaultSimEvent(double time)
DefaultSimEvent named \"No Name\", given time and null object and action.time - The time at which the event is to be scheduled on a SimEventList.public DefaultSimEvent()
DefaultSimEvent named \"No Name\", time at negative infinity and null object and action.public final String getName()
SimEventSimEvent.
The name may be null.
It is not used by the jsimulation package, except for logging purposes.
public final void setName(String name)
SimEventSimEvent.
The name may be null.
It is not used by the jsimulation package, except for logging purposes.
public String toString()
null, else the super method return value.public final double getTime()
SimEventSimEvent is (to be) scheduled on a SimEventList.
The time property should not be changed when the event is currently scheduled on a SimEventList.
getTime in interface SimEvent<T>SimEvent is (to be) scheduled on a SimEventList.public final void setTime(double time)
SimEventSimEvent is to be scheduled on a SimEventList.
The time property should not be changed when the event is currently scheduled on a SimEventList.
setTime in interface SimEvent<T>time - The new time at which this SimEvent is to be scheduled on a SimEventList.public final long getSimEventListDeconflictValue()
SimEventSimEventList.
This method is for internal use by a SimEventList.
Implementations must keep a private long (or Long) member to keep the property.
getSimEventListDeconflictValue in interface SimEvent<T>SimEventList.public final void setSimEventListDeconflictValue(long simEventListDeconflictValue)
SimEventSimEventList.
This method is for internal use by a SimEventList.
Implementations must keep a private long (or Long) member to keep the property.
setSimEventListDeconflictValue in interface SimEvent<T>simEventListDeconflictValue - The new value used for "de-conflicting" simultaneous events on a SimEventList.public final T getObject()
SimEvent
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.
public final void setObject(T object)
SimEvent
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.
public final SimEventAction getEventAction()
SimEventSimEventAction 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.
getEventAction in interface SimEvent<T>SimEventAction (may be null) associated with this event.public final void setEventAction(SimEventAction eventAction)
SimEventSimEventAction 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.
setEventAction in interface SimEvent<T>eventAction - The new SimEventAction (may be null) associated with this event.Copyright © 2018. All rights reserved.