|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnl.tudelft.simulation.dsol.eventlists.RedBlackTree
A RedBlackTree implementation of the eventlistInterface. This implementation is based on Java's TreeSet.
(c) copyright 2003 Delft
University of Technology , the Netherlands.
See for project information
www.simulation.tudelft.nl
License of use: General Public
License (GPL) , no warranty
| Field Summary | |
protected static boolean |
BLACK
BLACK |
protected int |
modCount
The number of structural modifications to the tree. |
protected static boolean |
RED
RED |
protected nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry |
root
the root of the tree |
protected int |
size
The number of entries in the tree |
| Constructor Summary | |
RedBlackTree()
constructs a new RedBlackTree |
|
| Method Summary | |
boolean |
add(SimEventInterface event)
adds an event to the eventlist |
boolean |
addAll(java.util.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(java.util.Collection collection)
returns whether the collection is in the list. |
protected void |
deleteEntry(nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry entry)
deletes entry , and then rebalance the tree. |
SimEventInterface |
first()
returns the first scheduled event |
protected nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry |
firstEntry()
returns the first entry from the RedBlackTree |
boolean |
isEmpty()
returns whether the eventlist is empty |
java.util.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(java.util.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 |
protected nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry |
successor(nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry entry)
Returns the successor of the specified Entry, or null if no such. |
SimEventInterface[] |
toArray()
returns the eventlist as array of simevents |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final boolean RED
protected static final boolean BLACK
protected transient nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry root
protected transient int size
protected transient int modCount
| Constructor Detail |
public RedBlackTree()
| Method Detail |
public boolean add(SimEventInterface event)
EventListInterface
add in interface EventListInterfaceevent - the event to add
#add(nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface)public boolean addAll(java.util.Collection collection)
EventListInterface
addAll in interface EventListInterfacecollection - the collection
#addAll(Collection)public void clear()
EventListInterface
clear in interface EventListInterfaceEventListInterface.clear()public boolean contains(SimEventInterface event)
EventListInterface
contains in interface EventListInterfaceevent - the event
#contains(nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface)public boolean containsAll(java.util.Collection collection)
EventListInterface
containsAll in interface EventListInterfacecollection - the collection to test
#containsAll(Collection)public SimEventInterface first()
EventListInterface
first in interface EventListInterface#first()public boolean isEmpty()
EventListInterface
isEmpty in interface EventListInterfaceEventListInterface.isEmpty()public java.util.Iterator iterator()
EventListInterface
iterator in interface EventListInterface#iterator()public SimEventInterface last()
EventListInterface
last in interface EventListInterfaceEventListInterface.last()public boolean remove(SimEventInterface event)
EventListInterface
remove in interface EventListInterfaceevent - the event to be removed
#remove(nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface)public boolean removeAll(java.util.Collection collection)
EventListInterface
removeAll in interface EventListInterfacecollection - the colleciton
EventListInterface.removeAll(Collection)public SimEventInterface removeFirst()
EventListInterface
removeFirst in interface EventListInterface#removeFirst()public SimEventInterface removeLast()
EventListInterface
removeLast in interface EventListInterfaceEventListInterface.removeLast()public int size()
EventListInterface
size in interface EventListInterfaceEventListInterface.size()public SimEventInterface[] toArray()
EventListInterface
toArray in interface EventListInterface#toArray()protected nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry firstEntry()
protected void deleteEntry(nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry entry)
entry - entryprotected nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry successor(nl.tudelft.simulation.dsol.eventlists.RedBlackTree.Entry entry)
entry - the entry
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||