|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Interface of bit index. Bit index allows to effiicently search object with specified set of properties. Each object has associated mask of 32 bites. Meaning of bits is application dependent. Usually each bit stands for some binary or boolean property, for example "sex", but it is possible to use group of bits to represent enumerations with more possible values.
| Method Summary | |
void |
clear()
Remove all objects from the index |
int |
get(IPersistent obj)
Get properties of specified object |
java.util.Iterator |
iterator()
Get iterator through all objects in the index This iterator doesn't support remove() method. |
java.util.Iterator |
iterator(int set,
int clear)
Get iterator for selecting objects with specified properties. |
void |
put(IPersistent obj,
int mask)
Put new object in the index. |
void |
remove(IPersistent obj)
Remove object from the index |
int |
size()
Get number of objects in the index |
| 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 clear()
public int get(IPersistent obj)
obj - object which properties are requested
StorageError(StorageError.KEY_NOT_FOUND) - exception if there is no object in the indexpublic java.util.Iterator iterator()
iterator in interface ITable
public java.util.Iterator iterator(int set,
int clear)
set - bitmask specifying bits which should be set (1)clear - bitmask specifying bits which should be cleared (0)
public void put(IPersistent obj,
int mask)
obj - object to be placed in the index. Object can be not yet peristent, in this case
its forced to become persistent by assigning OID to it.mask - bit mask associated with this objectspublic void remove(IPersistent obj)
obj - object removed from the index
StorageError(StorageError.KEY_NOT_FOUND) - exception if there is no such object in the indexpublic int size()
size in interface ITable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||