|
SPT Object Database API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.prevayler.IndexStorage
public class IndexStorage
A class used as the storage mechanism for storing the indices for prevalent objects in the prevalent system.
© Copyright 2008 Sans Pareil Technologies, Inc.
| Nested Class Summary | |
|---|---|
private class |
IndexStorage.FieldStorage
The storage used to maintain the indices for a field or combination of fields. |
| Field Summary | |
|---|---|
private static String |
NULL_VALUE
The constant used to index null keys. |
private static long |
serialVersionUID
|
private Map<String,IndexStorage.FieldStorage> |
storage
A map used to maintain indices for a prevalent object. |
| Constructor Summary | |
|---|---|
IndexStorage()
|
|
| Method Summary | |
|---|---|
void |
add(String[] fields,
Collection index,
PrevalentObject object)
Add a new index for the specified fields to the store. |
void |
add(String field,
Object index,
PrevalentObject object)
Add a new index for the specified field to the store. |
Collection<IndexedObject> |
get(String field,
Object index)
Return the collection of prevalent objects that match the specified index value. |
protected String |
getFieldName(String[] fields)
Return the name used to represent the specified array of field names. |
boolean |
isFieldIndexed(String field)
Determine whether the specified field is indexed. |
boolean |
isIndexed(String[] fields,
Object values)
Determines when the specified index exists in the store. |
boolean |
isIndexed(String field,
Object value)
Determines when the specified index exists in the store. |
void |
remove(PrevalentObject object)
Remove the indices for the specified prevalent object from the store. |
void |
remove(String field,
Object key,
PrevalentObject value)
Remove the index entry for the specified reference object that is refernced by the specified parent prevalent object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private static final String NULL_VALUE
private final Map<String,IndexStorage.FieldStorage> storage
key
to the map is the name(s) of the field(s) that are indexed,
and the values are IndexStorage.FieldStorage instances.
| Constructor Detail |
|---|
public IndexStorage()
| Method Detail |
|---|
public void add(String field,
Object index,
PrevalentObject object)
field - The name of the field that is indexed.index - The index for the field specified.object - The prevalent object to associate with the index.IndexStorage.FieldStorage.add(java.lang.Object, com.sptci.prevayler.PrevalentObject)
public void add(String[] fields,
Collection index,
PrevalentObject object)
fields - The array of field names that are being indexed.index - The index for the fields specified.object - The prevalent object to associate with the index.IndexStorage.FieldStorage.add(java.lang.Object, com.sptci.prevayler.PrevalentObject)public void remove(PrevalentObject object)
object - The prevalent object to remove from the store.IndexStorage.FieldStorage.remove(java.lang.Object, com.sptci.prevayler.PrevalentObject)
public void remove(String field,
Object key,
PrevalentObject value)
field - The name of the field that was indexed.key - The referenced object that was indexed.value - The parent prevalent object that holds a reference to
the indexed child prevalent object.
public Collection<IndexedObject> get(String field,
Object index)
index value.
field - The name of the field that was indexed in the prevalent
object.index - The value of the indexed field to use to retrieve the
objects.
public boolean isIndexed(String[] fields,
Object values)
fields - The array of field names that are indexed.values - The collection of values for the fields that are to be
checked for existence in the store.
true if the values are indexed in the
store.IndexStorage.FieldStorage.isIndexed(java.lang.Object)
public boolean isIndexed(String field,
Object value)
field - The field name that is indexed.value - The value that is to be checked for existence.
true if the value is indexed in the
store.IndexStorage.FieldStorage.isIndexed(java.lang.Object)public boolean isFieldIndexed(String field)
field - The name of the field that is to be checked.
true if the field is indexed.protected String getFieldName(String[] fields)
fields - The array of field names being indexed.
|
SPT Object Database API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||