nl.tudelft.simulation.dsol.eventlists
Interface EventListInterface

All Superinterfaces:
Serializable
All Known Implementing Classes:
RedBlackTree, TableModelEventList

public interface EventListInterface
extends Serializable

The EventListInterface defines the required methods for discrete event lists. A number of competitive algoritms can be used to implement such eventlist. Among these implementations are the Red-Black, the SplayTree, and others.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.0
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:21:28 $
Author:
Peter Jacobs

Method Summary
 boolean add(SimEventInterface event)
          adds an event to the eventlist
 boolean addAll(Collection collection)
          adds a collection of events to the tree
 void clear()
          clears the eventlist by removing all its scheduled events.
 boolean contains(SimEventInterface event)
          returns whether event is an entry of the eventlist
 boolean containsAll(Collection collection)
          returns whether the collection is in the list.
 SimEventInterface first()
          returns the first scheduled event
 boolean isEmpty()
          returns whether the eventlist is empty
 Iterator iterator()
          returns the iterator for this eventlist
 SimEventInterface last()
          returns the last scheduled event
 boolean remove(SimEventInterface event)
          removes the event from this tree
 boolean removeAll(Collection collection)
          removes a collection of events from this tree
 SimEventInterface removeFirst()
          removes the first event from the eventlist.
 SimEventInterface removeLast()
          removes the last event from the eventlist.
 int size()
          returns the number of scheduled events
 SimEventInterface[] toArray()
          returns the eventlist as array of simevents
 

Method Detail

add

boolean add(SimEventInterface event)
adds an event to the eventlist

Parameters:
event - the event to add
Returns:
true whenever the event was not already scheduled.

addAll

boolean addAll(Collection collection)
adds a collection of events to the tree

Parameters:
collection - the collection
Returns:
true whenever the collection was sucessfully added.

clear

void clear()
clears the eventlist by removing all its scheduled events.


contains

boolean contains(SimEventInterface event)
returns whether event is an entry of the eventlist

Parameters:
event - the event
Returns:
true if event in tree; otherwise false.

containsAll

boolean containsAll(Collection collection)
returns whether the collection is in the list.

Parameters:
collection - the collection to test
Returns:
true if event in tree; otherwise false.

first

SimEventInterface first()
returns the first scheduled event

Returns:
first scheduled event.

isEmpty

boolean isEmpty()
returns whether the eventlist is empty

Returns:
true if empty.

iterator

Iterator iterator()
returns the iterator for this eventlist

Returns:
the iterator

last

SimEventInterface last()
returns the last scheduled event

Returns:
last scheduled event.

remove

boolean remove(SimEventInterface event)
removes the event from this tree

Parameters:
event - the event to be removed
Returns:
true if the event was in the tree and succesfully removed.

removeAll

boolean removeAll(Collection collection)
removes a collection of events from this tree

Parameters:
collection - the colleciton
Returns:
true if the event was in the tree and succesfully removed.

removeFirst

SimEventInterface removeFirst()
removes the first event from the eventlist.

Returns:
the first event

removeLast

SimEventInterface removeLast()
removes the last event from the eventlist.

Returns:
the last event

size

int size()
returns the number of scheduled events

Returns:
the number of scheduled events.

toArray

SimEventInterface[] toArray()
returns the eventlist as array of simevents

Returns:
the eventlist as array of simevents.


Copyright © 2002-2010 Delft University of Technology, the Netherlands. All Rights Reserved.