org.garret.jsql
Class TTree

java.lang.Object
  extended byorg.garret.jsql.TTree
All Implemented Interfaces:
java.io.Serializable

public class TTree
extends java.lang.Object
implements java.io.Serializable

T-Tree contaniner for objects. T-Tree is most efficient data structure for exact and range data queries in the assumption that all data is present in memory. This class can be used in implementation of query iterators to provide fast indexed access to the records

See Also:
Serialized Form

Nested Class Summary
static interface TTree.Processor
          Interface for class processing elements of T-Tree during tree traversal
 
Constructor Summary
TTree(java.lang.reflect.Field f)
          Constructor of T-Tree
 
Method Summary
 void add(java.lang.Object obj)
          Add new object to T-Tree
 void clear()
          Remove all elements from T-Tree
 void remove(java.lang.Object obj)
          Remove object from T-Tree
 void select(java.lang.Object minValue, java.lang.Object maxValue, boolean inclusive, Query query)
          Locate record within sepcified key range
 void traverseBackward(TTree.Processor proc)
          Traverse T-Tree elements in descent order
 void traverseForward(TTree.Processor proc)
          Traverse T-Tree elements in ascent order
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TTree

public TTree(java.lang.reflect.Field f)
Constructor of T-Tree

Parameters:
f - indexed field in the record
Method Detail

select

public void select(java.lang.Object minValue,
                   java.lang.Object maxValue,
                   boolean inclusive,
                   Query query)
Locate record within sepcified key range

Parameters:
minValue - low bound for key value (if null, then there is no low bound
maxValue - high bound for key value (if null, then there is no high bound
inclusive - whether bounds are inclusive or exclusive
query - query to which records belongin to the specified range should be added using add method

add

public void add(java.lang.Object obj)
Add new object to T-Tree

Parameters:
obj - object to be inserted in T-Tree

remove

public void remove(java.lang.Object obj)
Remove object from T-Tree

Parameters:
obj - object to be removed from T-Tree

clear

public void clear()
Remove all elements from T-Tree


traverseForward

public void traverseForward(TTree.Processor proc)
Traverse T-Tree elements in ascent order


traverseBackward

public void traverseBackward(TTree.Processor proc)
Traverse T-Tree elements in descent order