|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.garret.jsql.HashMapIterator
Query iterator using hash table
Constructor Summary | |
HashMapIterator(java.lang.String key)
Constructor of hash iterator |
Method Summary | |
void |
add(java.lang.Object obj,
java.lang.Object keyValue)
Add new object |
QueryIterator |
concurrentIterator()
JSQL is able to perform sequential search in parallel. |
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 |
java.lang.Object |
getByPrimaryKey(java.lang.String key,
java.lang.Object keyValue)
Try to use index to locate object by unique primary key. |
java.lang.Object |
getFirst()
Get first object. |
java.lang.Object |
getNext(java.lang.Object prevObj,
int prevIndex)
Get next object. |
boolean |
isThreadSafe()
Check if it is possible to use iterator concurrently. |
void |
remove(java.lang.Object keyValue)
Remove object with specified key |
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HashMapIterator(java.lang.String key)
key
- primary key nameMethod Detail |
public java.lang.Object getByPrimaryKey(java.lang.String key, java.lang.Object keyValue)
QueryIterator
getByPrimaryKey
in interface QueryIterator
key
- name of primary key field. This files should be
unique among all searched object.keyValue
- key value
null
if object was not found.public java.lang.Object getFirst()
QueryIterator
getFirst
in interface QueryIterator
null
if there are no object to
search.public java.lang.Object getNext(java.lang.Object prevObj, int prevIndex)
QueryIterator
getNext
in interface QueryIterator
prevObj
- reference returned by previous call of
getNext
or getFirst
prevIndex
- index of previous object (starting from 0 for first
object)
null
if there are no more objectspublic boolean getByKeyRange(java.lang.String key, java.lang.Object minValue, java.lang.Object maxValue, boolean inclusive, Query result)
QueryIterator
getByKeyRange
in interface QueryIterator
key
- name of key field.minValue
- low bound for key value (if null
, then there
is no low boundmaxValue
- high bound for key value (if null
, then there
is no high boundinclusive
- whether bounds are inclusive or exclusiveresult
- query to which records belongin to the specified range should be added using
add
method
true
if index is applicable, false
otherwisepublic QueryIterator concurrentIterator()
QueryIterator
concurrentIterator
should either return this
if iterator is reentrant,
or clone the iterator. This method will be called prior any other access to the iterator by JSQL.
concurrentIterator
in interface QueryIterator
this
if iterator is reentrant or clone of iteratorpublic boolean isThreadSafe()
QueryIterator
isThreadSafe
in interface QueryIterator
true
is iterator can be use in parallel search, false
otherwisepublic boolean useNormalizedKeys()
QueryIterator
Query.normilizeKeyValue
method.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.
useNormalizedKeys
in interface QueryIterator
true
if key values are stored in the index in normalized formpublic void add(java.lang.Object obj, java.lang.Object keyValue)
obj
- new objectkeyValue
- value of primary key for this objectpublic void remove(java.lang.Object keyValue)
keyValue
- value of the primary key for removed object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |