An implementation of EventList using the doubly-linked indexed list of Henriksen [104] (see also [61] (p. More...
Public Member Functions | |
| boolean | isEmpty () |
| Returns true if and only if the event list is empty (no event is scheduled). | |
| void | clear () |
| Empties the event list, i.e., cancels all events. | |
| void | add (Event ev) |
| Adds a new event in the event list, according to the time of ev. | |
| void | addFirst (Event ev) |
| Adds a new event at the beginning of the event list. | |
| void | addBefore (Event ev, Event other) |
| Same as add, but adds the new event ev immediately before the event other in the list. | |
| void | addAfter (Event ev, Event other) |
| Same as add, but adds the new event ev immediately after the event other in the list. | |
| Event | getFirst () |
| Returns the first event in the event list. | |
| Event | getFirstOfClass (String cl) |
| Returns the first event of the class cl (a subclass of Event) in the event list. | |
| ListIterator< Event > | listIterator () |
| Returns a list iterator over the elements of the class Event in this list. | |
| boolean | remove (Event ev) |
| Removes the event ev from the event list (cancels this event). | |
| Event | removeFirst () |
| Removes the first event from the event list (to cancel or execute this event). | |
Package Functions | |
| public< E extends Event > E | getFirstOfClass (Class< E > cl) |
| Returns the first event of the class E (a subclass of Event) in the event list. | |
An implementation of EventList using the doubly-linked indexed list of Henriksen [104] (see also [61] (p.
207)).
Events are stored in a normal doubly-linked list. An additional index array is added to the structure to allow quick access to the events.
Definition at line 44 of file Henriksen.java.
| void umontreal.ssj.simevents.eventlist.Henriksen.add | ( | Event | ev | ) |
Adds a new event in the event list, according to the time of ev.
If the event list contains events scheduled to happen at the same time as ev, ev must be added after all these events.
| ev | event to be added |
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 113 of file Henriksen.java.
Same as add, but adds the new event ev immediately after the event other in the list.
| ev | event to be added |
| other | reference event after which ev will be added |
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 141 of file Henriksen.java.
Same as add, but adds the new event ev immediately before the event other in the list.
| ev | event to be added |
| other | reference event before which ev will be added |
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 130 of file Henriksen.java.
| void umontreal.ssj.simevents.eventlist.Henriksen.addFirst | ( | Event | ev | ) |
Adds a new event at the beginning of the event list.
The given event ev will occur at the current simulation time.
| ev | event to be added |
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 122 of file Henriksen.java.
| void umontreal.ssj.simevents.eventlist.Henriksen.clear | ( | ) |
Empties the event list, i.e., cancels all events.
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 98 of file Henriksen.java.
| Event umontreal.ssj.simevents.eventlist.Henriksen.getFirst | ( | ) |
Returns the first event in the event list.
If the event list is empty, returns null.
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 152 of file Henriksen.java.
|
package |
Returns the first event of the class E (a subclass of Event) in the event list.
If no such event is found, returns null.
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 168 of file Henriksen.java.
| Event umontreal.ssj.simevents.eventlist.Henriksen.getFirstOfClass | ( | String | cl | ) |
Returns the first event of the class cl (a subclass of Event) in the event list.
If no such event is found, returns null.
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 156 of file Henriksen.java.
| boolean umontreal.ssj.simevents.eventlist.Henriksen.isEmpty | ( | ) |
Returns true if and only if the event list is empty (no event is scheduled).
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 94 of file Henriksen.java.
| ListIterator< Event > umontreal.ssj.simevents.eventlist.Henriksen.listIterator | ( | ) |
Returns a list iterator over the elements of the class Event in this list.
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 182 of file Henriksen.java.
| boolean umontreal.ssj.simevents.eventlist.Henriksen.remove | ( | Event | ev | ) |
Removes the event ev from the event list (cancels this event).
Returns true if and only if the event removal has succeeded.
| ev | event to be removed |
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 186 of file Henriksen.java.
| Event umontreal.ssj.simevents.eventlist.Henriksen.removeFirst | ( | ) |
Removes the first event from the event list (to cancel or execute this event).
Returns the removed event. If the list is empty, then null is returned.
Implements umontreal.ssj.simevents.eventlist.EventList.
Definition at line 214 of file Henriksen.java.