SPT Object Database API

com.sptci.prevayler
Class IndexStorage.FieldStorage

java.lang.Object
  extended by com.sptci.prevayler.IndexStorage.FieldStorage
All Implemented Interfaces:
Serializable
Enclosing class:
IndexStorage

private class IndexStorage.FieldStorage
extends Object
implements Serializable

The storage used to maintain the indices for a field or combination of fields.


Field Summary
private  Map<Object,Collection<IndexedObject>> fieldMap
          The map used to maintain the indexed values and the prevalent objects that match the indexed values.
private static long serialVersionUID
           
 
Constructor Summary
private IndexStorage.FieldStorage()
           
 
Method Summary
private  void add(Object index, PrevalentObject object)
          Add the specified index and corresponding prevalent object to the store.
private  Collection<IndexedObject> get(Object index)
          Return the objects stored in fieldMap for the specified index key.
private  boolean isIndexed(Object values)
          Determine whether the specified value is indexed in the store.
private  void remove(Object key, PrevalentObject object)
           
private  void remove(PrevalentObject object)
          Remove the specified prevalent object from the store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

fieldMap

private final Map<Object,Collection<IndexedObject>> fieldMap
The map used to maintain the indexed values and the prevalent objects that match the indexed values. The key for the map are the indexed field(s) value(s) and the value is a collection that contains the prevalent object instances that match the index. If the index is unique the collection will have only one instance in it.

Note: The indexed values are not stored directly since that will drastically increate memory requirements for the system. The values stored are instances of IndexedObject from which the indexed object instance may be retrieved.

Constructor Detail

IndexStorage.FieldStorage

private IndexStorage.FieldStorage()
Method Detail

add

private void add(Object index,
                 PrevalentObject object)
Add the specified index and corresponding prevalent object to the store.

Parameters:
index - The index that is being added.
object - The prevalent object associated with the index.

remove

private void remove(Object key,
                    PrevalentObject object)

remove

private void remove(PrevalentObject object)
Remove the specified prevalent object from the store.

Parameters:
object - The prevalent object to remove from the store.

get

private Collection<IndexedObject> get(Object index)
Return the objects stored in fieldMap for the specified index key.

Parameters:
index - The index whose matching values are to be returned.
Returns:
The collection of indexed objects matching the specified index.

isIndexed

private boolean isIndexed(Object values)
Determine whether the specified value is indexed in the store.

Parameters:
values - The object(s) that are indexed.
Returns:
boolean Returns true if indexed.

SPT Object Database API