org.garret.consus
Class StringIndex

java.lang.Object
  extended by org.garret.consus.Persistent
      extended by org.garret.consus.StringIndex
All Implemented Interfaces:
java.lang.Cloneable

public abstract class StringIndex
extends Persistent
implements java.lang.Cloneable


Field Summary
 
Fields inherited from class org.garret.consus.Persistent
db, oid, PO_DELETED, PO_LOADED, PO_NEW, PO_STUB, state, type
 
Constructor Summary
StringIndex()
           
 
Method Summary
abstract  void clear()
          Remove all the objects from the index.
abstract  java.lang.Object clone()
          Clone index.
abstract  void insert(java.lang.String key, Persistent obj)
          Insert a new object in the index.
abstract  boolean insertUnique(java.lang.String key, Persistent obj)
          Insert a new object in the index.
abstract  boolean remove(java.lang.String key, Persistent obj)
          Remove an object from the index.
abstract  ConsusResultSet select()
          Selects all indexed objects.
abstract  ConsusResultSet select(boolean forUpdate)
          Selects all indexed objects,
abstract  ConsusResultSet select(java.lang.String key)
          Select objects with the specified value of the key.
abstract  ConsusResultSet select(java.lang.String firstKey, java.lang.String lastKey)
          Select an object with a value of the key greater-or-equal than firstKey and less-or-equal than lastKey.
abstract  ConsusResultSet select(java.lang.String firstKey, java.lang.String lastKey, boolean forUpdate)
          Select an object with a value of the key greater-or-equal than firstKey and less-or-equal than lastKey.
 ConsusResultSet selectForUpdate()
          Selects all indexed objects for update.
abstract  ConsusResultSet selectForUpdate(java.lang.String key)
          Select for update the objects with the specified value of the key.
abstract  ConsusResultSet selectForUpdate(java.lang.String firstKey, java.lang.String lastKey)
          Select for update an object with a value of the key greater-or-equal than firstKey and less-or-equal than lastKey.
abstract  java.lang.Object selectUnique(java.lang.String key)
          Select the object with the specified value of the key.
 
Methods inherited from class org.garret.consus.Persistent
assignOID, become, beginUpdate, endUpdate, get, get, getOid, getOid, getRef, getRef, isDeleted, isLoaded, isNew, load, loadClosure, loadComponents, lock, remove, save, store, store, toString, unget
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringIndex

public StringIndex()
Method Detail

clear

public abstract void clear()
Remove all the objects from the index.


clone

public abstract java.lang.Object clone()
                                throws java.lang.CloneNotSupportedException
Clone index.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

insert

public abstract void insert(java.lang.String key,
                            Persistent obj)
Insert a new object in the index.

Parameters:
obj - object to be placed in the index

insertUnique

public abstract boolean insertUnique(java.lang.String key,
                                     Persistent obj)
Insert a new object in the index.

Parameters:
obj - object to be placed in the index if unique constraint is not violated

remove

public abstract boolean remove(java.lang.String key,
                               Persistent obj)
Remove an object from the index.

Parameters:
obj - object to be removed from the index

select

public abstract ConsusResultSet select()
Selects all indexed objects.

Returns:
ResultSet with selected objects

select

public abstract ConsusResultSet select(boolean forUpdate)
Selects all indexed objects,

Parameters:
forUpdate - if objects are selected for update
Returns:
ResultSet with selected objects

select

public abstract ConsusResultSet select(java.lang.String key)
Select objects with the specified value of the key.

Parameters:
key - searched value
Returns:
ResultSet with selected objects

select

public abstract ConsusResultSet select(java.lang.String firstKey,
                                       java.lang.String lastKey)
Select an object with a value of the key greater-or-equal than firstKey and less-or-equal than lastKey.

Parameters:
firstKey - low bound of key rabge
lastKey - high bound of key rabge
Returns:
ResultSet with selected objects

select

public abstract ConsusResultSet select(java.lang.String firstKey,
                                       java.lang.String lastKey,
                                       boolean forUpdate)
Select an object with a value of the key greater-or-equal than firstKey and less-or-equal than lastKey.

Parameters:
firstKey - low bound of key rabge
lastKey - high bound of key rabge
forUpdate - if objects are selected for update
Returns:
ResultSet with selected objects

selectForUpdate

public ConsusResultSet selectForUpdate()
Selects all indexed objects for update.

Returns:
ResultSet with selected objects

selectForUpdate

public abstract ConsusResultSet selectForUpdate(java.lang.String key)
Select for update the objects with the specified value of the key.

Parameters:
key - searched value
Returns:
ResultSet with selected objects

selectForUpdate

public abstract ConsusResultSet selectForUpdate(java.lang.String firstKey,
                                                java.lang.String lastKey)
Select for update an object with a value of the key greater-or-equal than firstKey and less-or-equal than lastKey.

Parameters:
firstKey - low bound of key range
lastKey - high bound of key range
Returns:
ResultSet with selected objects

selectUnique

public abstract java.lang.Object selectUnique(java.lang.String key)
Select the object with the specified value of the key.

Parameters:
key - searched value
Returns:
object with specified value of the key, null if there are no such object