goldman.collection.ordered
Class TopDownBTree<E>

java.lang.Object
  extended by goldman.collection.AbstractCollection<E>
      extended by goldman.collection.ordered.AbstractSearchTree<E>
          extended by goldman.collection.ordered.BTree<E>
              extended by goldman.collection.ordered.TopDownBTree<E>
All Implemented Interfaces:
Collection<E>, OrderedCollection<E>, Iterable<E>

public class TopDownBTree<E>
extends BTree<E>
implements OrderedCollection<E>

The top down B-tree implements a variation of a B-tree that uses top-down (versus bottom-up) insertion and deletion.


Nested Class Summary
 
Nested classes/interfaces inherited from class goldman.collection.ordered.BTree
BTree.Marker
 
Nested classes/interfaces inherited from class goldman.collection.ordered.AbstractSearchTree
AbstractSearchTree.TreeNode
 
Nested classes/interfaces inherited from class goldman.collection.AbstractCollection
AbstractCollection.AbstractLocator<T extends E>, AbstractCollection.VisitingIterator
 
Field Summary
 
Fields inherited from class goldman.collection.ordered.AbstractSearchTree
root
 
Fields inherited from class goldman.collection.AbstractCollection
comp, DEFAULT_CAPACITY, NOT_FOUND, size, version
 
Constructor Summary
TopDownBTree()
           
TopDownBTree(Comparator<? super E> comp, int t)
           
TopDownBTree(int t)
           
 
Method Summary
protected  AbstractSearchTree.TreeNode insert(E element)
          Inserts it into the collection
 boolean remove(E element)
          Removes an arbitrary element in the collection equivalent to element, if any
 
Methods inherited from class goldman.collection.ordered.BTree
clear, createRoot, find, getLastNodeSearchIndex, getLocator, iterator, iteratorAtEnd, predecessor, remove, successor
 
Methods inherited from class goldman.collection.ordered.AbstractSearchTree
add, contains, get, getEquivalentElement, max, min, traverseForVisitor, writeElements
 
Methods inherited from class goldman.collection.AbstractCollection
accept, addAll, checkRep, compare, ensureCapacity, equivalent, getCapacity, getComparator, getElementAtRank, getElementAtRank, getSize, isEmpty, retainAll, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface goldman.collection.ordered.OrderedCollection
get, getEquivalentElement, iteratorAtEnd, max, min, predecessor, successor
 
Methods inherited from interface goldman.collection.Collection
accept, add, addAll, checkRep, clear, contains, ensureCapacity, getCapacity, getComparator, getLocator, getSize, isEmpty, iterator, retainAll, toArray, toArray, toString, trimToSize
 

Constructor Detail

TopDownBTree

public TopDownBTree()

TopDownBTree

public TopDownBTree(int t)

TopDownBTree

public TopDownBTree(Comparator<? super E> comp,
                    int t)
Method Detail

insert

protected AbstractSearchTree.TreeNode insert(E element)
Description copied from class: AbstractSearchTree
Inserts it into the collection

Overrides:
insert in class BTree<E>
Parameters:
element - the new element
Returns:
a reference to the newly added B-tree node

remove

public boolean remove(E element)
Description copied from class: AbstractSearchTree
Removes an arbitrary element in the collection equivalent to element, if any

Specified by:
remove in interface Collection<E>
Overrides:
remove in class AbstractSearchTree<E>
Parameters:
element - the element to be removed
Returns:
true if and only if an element is removed.