org.garret.jsql
Class TreeIterator

java.lang.Object
  extended byorg.garret.jsql.L2Elem
      extended byorg.garret.jsql.ListIterator
          extended byorg.garret.jsql.TreeIterator
All Implemented Interfaces:
QueryIterator, java.io.Serializable

public class TreeIterator
extends ListIterator

Query iterator using T-Tree

See Also:
Serialized Form

Constructor Summary
TreeIterator(java.lang.Class cls, java.lang.String keyName)
          Constructor of tree iterator
TreeIterator(java.lang.reflect.Field key)
          Constructor of tree iterator
 
Method Summary
 void add(L2Elem obj)
          Add new object
 boolean getByKeyRange(java.lang.String key, java.lang.Object minValue, java.lang.Object maxValue, boolean inclusive, Query result)
          Try to use index to select objects belonginh to the specified range
 void remove(L2Elem obj)
          Remove object from the tree
 boolean useNormalizedKeys()
          Check if iterator supporting direct access by key stores key values in normalized form (all integer types as Long, all real types as Double, other types as it is).
 
Methods inherited from class org.garret.jsql.ListIterator
concurrentIterator, getByPrimaryKey, getFirst, getNext, isThreadSafe
 
Methods inherited from class org.garret.jsql.L2Elem
getNext, getPrevious, isEmpty, link, unlink
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeIterator

public TreeIterator(java.lang.reflect.Field key)
Constructor of tree iterator

Parameters:
key - key field

TreeIterator

public TreeIterator(java.lang.Class cls,
                    java.lang.String keyName)
             throws java.lang.NoSuchFieldException
Constructor of tree iterator

Parameters:
cls - class of the members
keyName - name of key field
Method Detail

getByKeyRange

public boolean getByKeyRange(java.lang.String key,
                             java.lang.Object minValue,
                             java.lang.Object maxValue,
                             boolean inclusive,
                             Query result)
Description copied from interface: QueryIterator
Try to use index to select objects belonginh to the specified range

Specified by:
getByKeyRange in interface QueryIterator
Overrides:
getByKeyRange in class ListIterator

useNormalizedKeys

public boolean useNormalizedKeys()
Description copied from interface: QueryIterator
Check if iterator supporting direct access by key stores key values in normalized form (all integer types as Long, all real types as Double, other types as it is). Normalization of key value should be performed using Query.normilizeKeyValue method.
If this method returns false then JSQL will try to convert search literals to the type of the indexed field. But it is possible only if type of the field is known at query compilation time. Otherwise in case of using dynamic binding such covertsion should be performed by iterator itself using Query.castLiteral method.

Specified by:
useNormalizedKeys in interface QueryIterator
Overrides:
useNormalizedKeys in class ListIterator

add

public void add(L2Elem obj)
Add new object

Overrides:
add in class ListIterator
Parameters:
obj - new object

remove

public void remove(L2Elem obj)
Remove object from the tree

Parameters:
obj - removed object