pt.ist.fenixframework.core.adt.bplustree
Class BPlusTreeArray<T extends AbstractDomainObject>

Package class diagram package BPlusTreeArray
java.lang.Object
  extended by pt.ist.fenixframework.core.AbstractDomainObject
      extended by pt.ist.fenixframework.core.adt.bplustree.BPlusTreeArray_Base
          extended by pt.ist.fenixframework.core.adt.bplustree.BPlusTreeArray<T>
All Implemented Interfaces:
Serializable, Iterable<T>, Collection<T>, Set<T>, DomainObject

public class BPlusTreeArray<T extends AbstractDomainObject>
extends BPlusTreeArray_Base
implements Set<T>

Implementation of a persistence-independent B+Tree that is specifically optimized to store instances of AbstractDomainObject. This implementation is modelled in DML and can be used with any backend.

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.core.adt.bplustree.BPlusTreeArray_Base
BPlusTreeArrayHasRootNode, role$$root
 
Constructor Summary
BPlusTreeArray()
           
 
Method Summary
 boolean add(T e)
           
 boolean addAll(Collection<? extends T> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 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).
 boolean insert(T value)
          Inserts the given value.
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean myEquals(BPlusTreeArray other)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 T removeIndex(int index)
          Remove and return the value at the index-th position (zero-based).
 boolean removeKey(Comparable key)
          Removes the element with the given key
 boolean retainAll(Collection<?> c)
           
 int size()
          Returns the number of key-value mappings in this map
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class pt.ist.fenixframework.core.adt.bplustree.BPlusTreeArray_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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Constructor Detail

BPlusTreeArray

public BPlusTreeArray()
Method Detail

insert

public boolean insert(T value)
Inserts the given value.


removeKey

public boolean removeKey(Comparable key)
Removes the element with the given key


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.


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

Specified by:
size in interface Collection<T extends AbstractDomainObject>
Specified by:
size in interface Set<T extends AbstractDomainObject>

dump

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

iterator

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

myEquals

public boolean myEquals(BPlusTreeArray other)

add

public boolean add(T e)
Specified by:
add in interface Collection<T extends AbstractDomainObject>
Specified by:
add in interface Set<T extends AbstractDomainObject>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<T extends AbstractDomainObject>
Specified by:
remove in interface Set<T extends AbstractDomainObject>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<T extends AbstractDomainObject>
Specified by:
contains in interface Set<T extends AbstractDomainObject>

addAll

public boolean addAll(Collection<? extends T> c)
Specified by:
addAll in interface Collection<T extends AbstractDomainObject>
Specified by:
addAll in interface Set<T extends AbstractDomainObject>

clear

public void clear()
Specified by:
clear in interface Collection<T extends AbstractDomainObject>
Specified by:
clear in interface Set<T extends AbstractDomainObject>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<T extends AbstractDomainObject>
Specified by:
containsAll in interface Set<T extends AbstractDomainObject>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<T extends AbstractDomainObject>
Specified by:
isEmpty in interface Set<T extends AbstractDomainObject>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<T extends AbstractDomainObject>
Specified by:
removeAll in interface Set<T extends AbstractDomainObject>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<T extends AbstractDomainObject>
Specified by:
retainAll in interface Set<T extends AbstractDomainObject>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<T extends AbstractDomainObject>
Specified by:
toArray in interface Set<T extends AbstractDomainObject>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<T extends AbstractDomainObject>
Specified by:
toArray in interface Set<T extends AbstractDomainObject>


Copyright © 2013. All Rights Reserved.