ehcache

net.sf.ehcache.store.disk.ods
Class AATreeSet<T extends Comparable>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<T>
          extended by net.sf.ehcache.store.disk.ods.AATreeSet<T>
Type Parameters:
T - type of values stored
All Implemented Interfaces:
Iterable<T>, Collection<T>, Set<T>, SortedSet<T>
Direct Known Subclasses:
FileAllocationTree

public class AATreeSet<T extends Comparable>
extends AbstractSet<T>
implements SortedSet<T>

A AA-Tree based SortedSet implementation

Author:
Chris Dennis

Nested Class Summary
static class AATreeSet.AbstractTreeNode<E>
          Abstract node implementation that can be extended with a custom payload.
static interface AATreeSet.Node<E>
          Interface implemented by nodes within this tree.
 
Constructor Summary
AATreeSet()
           
 
Method Summary
 boolean add(T o)
           
 void clear()
           
 Comparator<? super T> comparator()
          
 T find(Object probe)
          Find the node within this tree equal to the probe node.
 T first()
          
protected  AATreeSet.Node<T> getRoot()
          Returns the root node of this tree.
 SortedSet<T> headSet(T toElement)
          
 boolean isEmpty()
           
 Iterator<T> iterator()
           
 T last()
          
 boolean remove(Object o)
           
 T removeAndReturn(Object o)
          Remove the node matching this object and return it.
 int size()
           
 SortedSet<T> subSet(T fromElement, T toElement)
          
 SortedSet<T> tailSet(T fromElement)
          
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
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
 
Methods inherited from interface java.util.Set
addAll, contains, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

AATreeSet

public AATreeSet()
Method Detail

add

public boolean add(T o)
Specified by:
add in interface Collection<T extends Comparable>
Specified by:
add in interface Set<T extends Comparable>
Overrides:
add in class AbstractCollection<T extends Comparable>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<T extends Comparable>
Specified by:
remove in interface Set<T extends Comparable>
Overrides:
remove in class AbstractCollection<T extends Comparable>

removeAndReturn

public T removeAndReturn(Object o)
Remove the node matching this object and return it.


clear

public void clear()
Specified by:
clear in interface Collection<T extends Comparable>
Specified by:
clear in interface Set<T extends Comparable>
Overrides:
clear in class AbstractCollection<T extends Comparable>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends Comparable>
Specified by:
iterator in interface Collection<T extends Comparable>
Specified by:
iterator in interface Set<T extends Comparable>
Specified by:
iterator in class AbstractCollection<T extends Comparable>

size

public int size()
Specified by:
size in interface Collection<T extends Comparable>
Specified by:
size in interface Set<T extends Comparable>
Specified by:
size in class AbstractCollection<T extends Comparable>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<T extends Comparable>
Specified by:
isEmpty in interface Set<T extends Comparable>
Overrides:
isEmpty in class AbstractCollection<T extends Comparable>

comparator

public Comparator<? super T> comparator()

Specified by:
comparator in interface SortedSet<T extends Comparable>

subSet

public SortedSet<T> subSet(T fromElement,
                           T toElement)

Specified by:
subSet in interface SortedSet<T extends Comparable>

headSet

public SortedSet<T> headSet(T toElement)

Specified by:
headSet in interface SortedSet<T extends Comparable>

tailSet

public SortedSet<T> tailSet(T fromElement)

Specified by:
tailSet in interface SortedSet<T extends Comparable>

first

public T first()

Specified by:
first in interface SortedSet<T extends Comparable>

last

public T last()

Specified by:
last in interface SortedSet<T extends Comparable>

find

public T find(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.


ehcache

Copyright 2001-2014, Terracotta, Inc.