Package org.opentrafficsim.core.dsol
Class SynchronizedRedBlackTree<T extends SimTime<?,?,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:
- java.io.Serializable,- java.lang.Iterable<SimEventInterface<T>>,- java.util.Collection<SimEventInterface<T>>,- java.util.Set<SimEventInterface<T>>,- java.util.SortedSet<SimEventInterface<T>>,- EventListInterface<T>
 
 public class SynchronizedRedBlackTree<T extends SimTime<?,?,T>> extends java.lang.Object implements EventListInterface<T>, java.io.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
- Version:
- $Revision: 1.2 $ $Date: 2010/08/10 11:36:45 $
- Author:
- Peter Jacobs
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description SynchronizedRedBlackTree()Constructs a newSynchronizedRedBlackTree.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(SimEventInterface<T> e)booleanaddAll(java.util.Collection<? extends SimEventInterface<T>> c)voidclear()java.util.Comparator<? super SimEventInterface<T>>comparator()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)SimEventInterface<T>first()we re-implemented the first method.java.util.SortedSet<SimEventInterface<T>>headSet(SimEventInterface<T> toElement)booleanisEmpty()java.util.Iterator<SimEventInterface<T>>iterator()SimEventInterface<T>last()we re-implemented the last method.booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)SimEventInterface<T>removeFirst()SimEventInterface<T>removeLast()booleanretainAll(java.util.Collection<?> c)intsize()java.util.SortedSet<SimEventInterface<T>>subSet(SimEventInterface<T> fromElement, SimEventInterface<T> toElement)java.util.SortedSet<SimEventInterface<T>>tailSet(SimEventInterface<T> fromElement)java.lang.Object[]toArray()<X> X[]toArray(X[] a)java.lang.StringtoString()
 
- 
- 
- 
Method Detail- 
removeFirstpublic SimEventInterface<T> removeFirst() - Specified by:
- removeFirstin interface- EventListInterface<T extends SimTime<?,?,T>>
 
 - 
removeLastpublic SimEventInterface<T> removeLast() - Specified by:
- removeLastin interface- EventListInterface<T extends SimTime<?,?,T>>
 
 - 
firstpublic SimEventInterface<T> first() we re-implemented the first method. Instead of throwing exceptions if the tree is empty, we return a null value.
 - 
lastpublic SimEventInterface<T> last() we re-implemented the last method. Instead of throwing exceptions if the tree is empty, we return a null value.
 - 
comparatorpublic java.util.Comparator<? super SimEventInterface<T>> comparator() 
 - 
subSetpublic java.util.SortedSet<SimEventInterface<T>> subSet(SimEventInterface<T> fromElement, SimEventInterface<T> toElement) 
 - 
headSetpublic java.util.SortedSet<SimEventInterface<T>> headSet(SimEventInterface<T> toElement) 
 - 
tailSetpublic java.util.SortedSet<SimEventInterface<T>> tailSet(SimEventInterface<T> fromElement) 
 - 
sizepublic int size() 
 - 
isEmptypublic boolean isEmpty() 
 - 
containspublic boolean contains(java.lang.Object o) 
 - 
iteratorpublic java.util.Iterator<SimEventInterface<T>> iterator() 
 - 
toArraypublic java.lang.Object[] toArray() 
 - 
toArraypublic <X> X[] toArray(X[] a) 
 - 
addpublic boolean add(SimEventInterface<T> e) 
 - 
removepublic boolean remove(java.lang.Object o) 
 - 
containsAllpublic boolean containsAll(java.util.Collection<?> c) 
 - 
addAllpublic boolean addAll(java.util.Collection<? extends SimEventInterface<T>> c) 
 - 
retainAllpublic boolean retainAll(java.util.Collection<?> c) 
 - 
removeAllpublic boolean removeAll(java.util.Collection<?> c) 
 - 
clearpublic void clear() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-