Package net.sf.ehcache.store.disk.ods
Class AATreeSet<T extends java.lang.Comparable>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<T>
-
- net.sf.ehcache.store.disk.ods.AATreeSet<T>
-
- Type Parameters:
T- type of values stored
- All Implemented Interfaces:
java.lang.Iterable<T>,java.util.Collection<T>,java.util.Set<T>,java.util.SortedSet<T>
- Direct Known Subclasses:
FileAllocationTree
public class AATreeSet<T extends java.lang.Comparable> extends java.util.AbstractSet<T> implements java.util.SortedSet<T>A AA-Tree based SortedSet implementation- Author:
- Chris Dennis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAATreeSet.AbstractTreeNode<E>Abstract node implementation that can be extended with a custom payload.static interfaceAATreeSet.Node<E>Interface implemented by nodes within this tree.
-
Constructor Summary
Constructors Constructor Description AATreeSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T o)voidclear()java.util.Comparator<? super T>comparator()Tfind(java.lang.Object probe)Find the node within this tree equal to the probe node.Tfirst()protected AATreeSet.Node<T>getRoot()Returns the root node of this tree.java.util.SortedSet<T>headSet(T toElement)booleanisEmpty()java.util.Iterator<T>iterator()Tlast()booleanremove(java.lang.Object o)TremoveAndReturn(java.lang.Object o)Remove the node matching this object and return it.intsize()java.util.SortedSet<T>subSet(T fromElement, T toElement)java.util.SortedSet<T>tailSet(T fromElement)-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
add
public boolean add(T o)
-
remove
public boolean remove(java.lang.Object o)
-
removeAndReturn
public T removeAndReturn(java.lang.Object o)
Remove the node matching this object and return it.
-
clear
public void clear()
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iteratorin interfacejava.util.Collection<T extends java.lang.Comparable>- Specified by:
iteratorin interfacejava.lang.Iterable<T extends java.lang.Comparable>- Specified by:
iteratorin interfacejava.util.Set<T extends java.lang.Comparable>- Specified by:
iteratorin classjava.util.AbstractCollection<T extends java.lang.Comparable>
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
comparator
public java.util.Comparator<? super T> comparator()
- Specified by:
comparatorin interfacejava.util.SortedSet<T extends java.lang.Comparable>
-
subSet
public java.util.SortedSet<T> subSet(T fromElement, T toElement)
- Specified by:
subSetin interfacejava.util.SortedSet<T extends java.lang.Comparable>
-
headSet
public java.util.SortedSet<T> headSet(T toElement)
- Specified by:
headSetin interfacejava.util.SortedSet<T extends java.lang.Comparable>
-
tailSet
public java.util.SortedSet<T> tailSet(T fromElement)
- Specified by:
tailSetin interfacejava.util.SortedSet<T extends java.lang.Comparable>
-
first
public T first()
- Specified by:
firstin interfacejava.util.SortedSet<T extends java.lang.Comparable>
-
last
public T last()
- Specified by:
lastin interfacejava.util.SortedSet<T extends java.lang.Comparable>
-
find
public T find(java.lang.Object probe)
Find the node within this tree equal to the probe node.
-
getRoot
protected final AATreeSet.Node<T> getRoot()
Returns the root node of this tree.
-
-