vanetsim.scenario.events
Class EventList

java.lang.Object
  extended by vanetsim.scenario.events.EventList

public final class EventList
extends java.lang.Object

This class stores all events.


Method Summary
 void addCurrentBlockings(StartBlocking event)
          Adds an event to the list of currently active events.
 void addEvent(Event event)
          Adds an event.
 void clearEvents()
          Removes all events.
 void delCurrentBlockings(StartBlocking event)
          Removes an event from the list of currently active events.
 void delEvent(Event event)
          Removes an event.
 java.util.ArrayList<StartBlocking> getAllBlockingsArrayList()
          Gets the list with all blocking events.
 java.util.ArrayList<StartBlocking> getCurrentBlockingsArrayList()
          Gets the list with the currently active events.
static EventList getInstance()
          Gets the single instance of this EventList.
 java.util.Iterator<Event> getIterator()
          Gets an iterator over all events.
 void processEvents(int time)
          Process next event(s).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EventList getInstance()
Gets the single instance of this EventList.

Returns:
single instance of this EventList

addEvent

public void addEvent(Event event)
Adds an event.

Parameters:
event - the event

delEvent

public void delEvent(Event event)
Removes an event.

Parameters:
event - the event

clearEvents

public void clearEvents()
Removes all events.


getIterator

public java.util.Iterator<Event> getIterator()
Gets an iterator over all events.

Returns:
the iterator

getAllBlockingsArrayList

public java.util.ArrayList<StartBlocking> getAllBlockingsArrayList()
Gets the list with all blocking events. Note that this is not optimal for application performance as new a complete new ArrayList is created (applies only if there are lots of events).

Returns:
the an array list with all blocking events.

getCurrentBlockingsArrayList

public java.util.ArrayList<StartBlocking> getCurrentBlockingsArrayList()
Gets the list with the currently active events.

Returns:
the current events array list

addCurrentBlockings

public void addCurrentBlockings(StartBlocking event)
Adds an event to the list of currently active events.

Parameters:
event - the event

delCurrentBlockings

public void delCurrentBlockings(StartBlocking event)
Removes an event from the list of currently active events.

Parameters:
event - the event

processEvents

public void processEvents(int time)
Process next event(s).

Parameters:
time - the current absolute time of the simulation