Package org.opentrafficsim.core.dsol
Class SynchronizedRedBlackTree<T extends Number & Comparable<T>>
java.lang.Object
org.opentrafficsim.core.dsol.SynchronizedRedBlackTree<T>
- Type Parameters:
T- the type of simulation time, e.g. SimTimeCalendarLong or SimTimeDouble or SimTimeDoubleUnit.
- All Implemented Interfaces:
Serializable,Iterable<nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<T>>,nl.tudelft.simulation.dsol.eventlists.EventListInterface<T>
public class SynchronizedRedBlackTree<T extends Number & Comparable<T>>
extends Object
implements nl.tudelft.simulation.dsol.eventlists.EventListInterface<T>, Serializable
A SynchronizedRedBlackTree implementation of the eventlistInterface. This implementation is based on Java's TreeSet.
(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.5
- Author:
- Peter Jacobs
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()booleannl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<T>first()we re-implemented the first method.booleanisEmpty()iterator()booleannl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<T>intsize()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SynchronizedRedBlackTree
public SynchronizedRedBlackTree()Constructs a newSynchronizedRedBlackTree.
-
-
Method Details
-
removeFirst
- Specified by:
removeFirstin interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>
-
first
we re-implemented the first method. Instead of throwing exceptions if the tree is empty, we return a null value.- Specified by:
firstin interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>- Returns:
- the first SimEvent in the tree.
- See Also:
-
size
public int size()- Specified by:
sizein interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>
-
contains
public boolean contains(nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<T> o) - Specified by:
containsin interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>
-
iterator
public Iterator<nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<T>> iterator()- Specified by:
iteratorin interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>- Specified by:
iteratorin interfaceIterable<T extends Number & Comparable<T>>
-
add
- Specified by:
addin interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>
-
remove
- Specified by:
removein interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>
-
clear
public void clear()- Specified by:
clearin interfacenl.tudelft.simulation.dsol.eventlists.EventListInterface<T extends Number & Comparable<T>>
-
toString
-