SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
EventList.java
1/*
2 * Class: EventList
3 * Description: interface for implementations of event lists
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author
9 * @since
10 *
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 */
25package umontreal.ssj.simevents.eventlist;
26
27import java.util.ListIterator;
28import umontreal.ssj.simevents.Event;
29
65public interface EventList extends Iterable<Event> {
66
73 public boolean isEmpty();
74
78 public void clear();
79
87 public void add(Event ev);
88
95 public void addFirst(Event ev);
96
104 public void addBefore(Event ev, Event other);
105
113 public void addAfter(Event ev, Event other);
114
122 public Event getFirst();
123
132 public Event getFirstOfClass(String cl);
133
142 public <E extends Event> E getFirstOfClass(Class<E> cl);
143
151 public ListIterator<Event> listIterator();
152
160 public boolean remove(Event ev);
161
171
172}
This abstract class provides event scheduling tools.
Definition Event.java:53
An interface for implementations of event lists.
Event getFirst()
Returns the first event in the event list.
ListIterator< Event > listIterator()
Returns a list iterator over the elements of the class Event in this list.
Event removeFirst()
Removes the first event from the event list (to cancel or execute this event).
void addBefore(Event ev, Event other)
Same as add, but adds the new event ev immediately before the event other in the list.
Event getFirstOfClass(String cl)
Returns the first event of the class cl (a subclass of Event) in the event list.
void addAfter(Event ev, Event other)
Same as add, but adds the new event ev immediately after the event other in the list.
boolean isEmpty()
Returns true if and only if the event list is empty (no event is scheduled).
void add(Event ev)
Adds a new event in the event list, according to the time of ev.
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.
void clear()
Empties the event list, i.e., cancels all events.
void addFirst(Event ev)
Adds a new event at the beginning of the event list.