pt.ist.fenixframework.adt.bplustree
Class BPlusTree<T extends Serializable>

Package class diagram package BPlusTree
java.lang.Object
  extended by pt.ist.fenixframework.core.AbstractDomainObject
      extended by pt.ist.fenixframework.adt.bplustree.BPlusTree_Base
          extended by pt.ist.fenixframework.adt.bplustree.BPlusTree<T>
All Implemented Interfaces:
Serializable, IBPlusTree<T>, DomainObject

public class BPlusTree<T extends Serializable>
extends BPlusTree_Base
implements IBPlusTree<T>

Implementation of a persistence-independent B+Tree. This implementation is modelled in DML and can be used with any backend. This B+Tree can store any value (except nulls) associated with any key as long as the following restrictions are followed: Both the key and the value need to be Serializable; the key also needs to be Comparable; and keys must comparable to each other (e.g. the same BPlusTree instance cannot simultaneously support keys of type Integer and String).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class pt.ist.fenixframework.core.AbstractDomainObject
AbstractDomainObject.SerializedForm
 
Field Summary
 
Fields inherited from class pt.ist.fenixframework.adt.bplustree.BPlusTree_Base
AdtBPlusTreeHasRootNode, role$$root
 
Constructor Summary
BPlusTree()
           
 
Method Summary
 boolean containsKey(Comparable key)
          Returns true if this map contains a mapping for the specified key.
 String dump(int level, boolean dumpKeysOnly, boolean dumpNodeIds)
           
 T get(Comparable key)
          Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
 T getIndex(int index)
          Return the value at the index-th position (zero-based).
<T extends Comparable>
Set<T>
getKeys()
          Returns the set of keys mapped by this tree
 void insert(Comparable key, T value)
          Inserts the given key-value pair, overwriting any previous entry for the same key
 Iterator iterator()
           
 boolean myEquals(BPlusTree other)
           
 void remove(Comparable key)
          Removes the element with the given key
 T removeIndex(int index)
          Remove and return the value at the index-th position (zero-based).
 int size()
          Returns the number of key-value mappings in this map
 
Methods inherited from class pt.ist.fenixframework.adt.bplustree.BPlusTree_Base
getRoot, hasRoot, removeRoot, setRoot
 
Methods inherited from class pt.ist.fenixframework.core.AbstractDomainObject
ensureOid, equals, getExternalId, getOid, hashCode, makeSerializedForm, toString, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BPlusTree

public BPlusTree()
Method Detail

insert

public void insert(Comparable key,
                   T value)
Inserts the given key-value pair, overwriting any previous entry for the same key

Specified by:
insert in interface IBPlusTree<T extends Serializable>

remove

public void remove(Comparable key)
Removes the element with the given key

Specified by:
remove in interface IBPlusTree<T extends Serializable>

get

public T get(Comparable key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Specified by:
get in interface IBPlusTree<T extends Serializable>

getIndex

public T getIndex(int index)
Return the value at the index-th position (zero-based).


removeIndex

public T removeIndex(int index)
Remove and return the value at the index-th position (zero-based).


containsKey

public boolean containsKey(Comparable key)
Returns true if this map contains a mapping for the specified key.


size

public int size()
Returns the number of key-value mappings in this map


dump

public String dump(int level,
                   boolean dumpKeysOnly,
                   boolean dumpNodeIds)

iterator

public Iterator iterator()

myEquals

public boolean myEquals(BPlusTree other)

getKeys

public <T extends Comparable> Set<T> getKeys()
Returns the set of keys mapped by this tree



Copyright © 2013. All Rights Reserved.