|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
public interface FieldIndex<T extends IPersistent>
Interface of indexed field. Index is used to provide fast access to the object by the value of indexed field. Objects in the index are stored ordered by the value of indexed field. It is possible to select object using exact value of the key or select set of objects which key belongs to the specified interval (each boundary can be specified or unspecified and can be inclusive or exclusive) Key should be of scalar, String, java.util.Date or peristent object type.
| Field Summary |
|---|
| Fields inherited from interface org.garret.perst.GenericIndex |
|---|
ASCENT_ORDER, DESCENT_ORDER |
| Method Summary | |
|---|---|
void |
append(T obj)
Assign to the integer indexed field unique autoicremented value and insert object in the index. |
boolean |
contains(T obj)
Check if index contains object which is equal to the specified object. |
boolean |
containsObject(T obj)
Check if index contains specified object instance. |
java.lang.Class |
getIndexedClass()
Get class obejct objects which can be inserted in this index |
java.lang.reflect.Field[] |
getKeyFields()
Get fields used as a key |
boolean |
isCaseInsensitive()
Check if field index is case insensitive |
boolean |
put(T obj)
Put new object in the index. |
IterableIterator<T> |
queryByExample(T obj)
Locate objects with the same value of the key as specified object |
T |
remove(Key key)
Remove object with specified key from the unique index |
void |
remove(T obj)
Remove object from the index |
T |
removeKey(java.lang.Object key)
Remove object with specified key from the unique index |
IterableIterator<T> |
select(java.lang.String predicate)
Select members of the collection using search predicate This iterator doesn't support remove() method. |
T |
set(T obj)
Associate new object with the key specified by object field value. |
| Methods inherited from interface org.garret.perst.GenericIndex |
|---|
clear, entryIterator, entryIterator, entryIterator, entryIterator, get, get, get, get, getAt, getKeyType, getKeyTypes, getList, getList, getPrefix, getPrefixList, isUnique, iterator, iterator, iterator, prefixIterator, prefixSearch, prefixSearchList, size, toPersistentArray |
| Methods inherited from interface org.garret.perst.IPersistent |
|---|
assignOid, deallocate, getOid, getStorage, invalidate, isDeleted, isModified, isPersistent, isRaw, load, loadAndModify, makePersistent, modify, onLoad, onStore, recursiveLoading, store |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Methods inherited from interface org.garret.perst.IResource |
|---|
exclusiveLock, exclusiveLock, reset, sharedLock, sharedLock, unlock |
| Methods inherited from interface org.garret.perst.ITable |
|---|
select |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Method Detail |
|---|
void append(T obj)
obj - object to be inserted in index. Object should contain indexed field
of integer (int or long) type.
This field is assigned unique value (which will not be reused while
this index exists) and object is marked as modified.
Object can be not yet peristent, in this case
its forced to become persistent by assigning OID to it.
StorageError(StorageError.INCOMPATIBLE_KEY_TYPE) - when indexed field
has type other than int or longboolean contains(T obj)
obj - object to be searched in the index. Object should contain indexed field.
true if collection contains object equals to the specifiedboolean containsObject(T obj)
obj - object to be searched in the index. Object should contain indexed field.
true if object is present in the index, false otherwisejava.lang.Class getIndexedClass()
java.lang.reflect.Field[] getKeyFields()
boolean isCaseInsensitive()
boolean put(T obj)
obj - object to be inserted in index. Object should contain indexed field.
Object can be not yet peristent, in this case
its forced to become persistent by assigning OID to it.
true if object is successfully inserted in the index,
false if index was declared as unique and there is already object with such value
of the key in the index.IterableIterator<T> queryByExample(T obj)
obj - object specifying search key value
T remove(Key key)
key - value of removed key
StorageError(StorageError.KEY_NOT_FOUND) - exception if there is no such key in the index,
or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.void remove(T obj)
obj - object removed from the index. Object should contain indexed field.
StorageError(StorageError.KEY_NOT_FOUND) - exception if there is no such key in the indexT removeKey(java.lang.Object key)
key - value of removed key
StorageError(StorageError.KEY_NOT_FOUND) - exception if there is no such key in the index,
or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.IterableIterator<T> select(java.lang.String predicate)
predicate - JSQL condition
T set(T obj)
obj - object to be inserted in index. Object should contain indexed field.
Object can be not yet peristent, in this case
its forced to become persistent by assigning OID to it.
null if there was no such object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||