|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
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(IPersistent obj)
Assign to the integer indexed field unique autoicremented value and insert object in the index. |
boolean |
contains(IPersistent obj)
Check if index contains object which is equal to the specified object. |
boolean |
containsObject(IPersistent 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 |
put(IPersistent obj)
Put new object in the index. |
void |
remove(IPersistent obj)
Remove object from the index |
IPersistent |
remove(Key key)
Remove object with specified key from the unique index |
java.util.Iterator |
select(java.lang.String predicate)
Select members of the collection using search predicate. |
IPersistent |
set(IPersistent obj)
Associate new object with the key specified by object field value. |
| Methods inherited from interface org.garret.perst.GenericIndex |
clear, entryIterator, entryIterator, get, get, get, getKeyType, getKeyTypes, getPrefix, iterator, iterator, prefixIterator, prefixSearch, size, toPersistentArray, 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 |
| Method Detail |
public void append(IPersistent 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 longpublic boolean contains(IPersistent obj)
obj - object to be searched in the index. Object should contain indexed field.
true if collection contains object equals to the specifiedpublic boolean containsObject(IPersistent obj)
obj - object to be searched in the index. Object should contain indexed field.
true if object is present in the index, false otherwisepublic java.lang.Class getIndexedClass()
public java.lang.reflect.Field[] getKeyFields()
public boolean put(IPersistent 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.public void remove(IPersistent 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 indexpublic IPersistent 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.public java.util.Iterator select(java.lang.String predicate)
predicate - JSQL condition
public IPersistent set(IPersistent 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 | |||||||