|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.wotonomy.datastore.FileSoup
public abstract class FileSoup
| Field Summary | |
|---|---|
protected java.io.File |
homeDirectory
|
static java.lang.String |
INDEX_SUFFIX
|
protected java.util.Map |
indices
|
static java.lang.String |
MAP_SUFFIX
|
protected DataKey |
nextUniqueIdentifier
|
| Constructor Summary | |
|---|---|
FileSoup(java.lang.String aPath)
|
|
| Method Summary | |
|---|---|
void |
addIndex(java.lang.String aName,
java.lang.String aProperty)
Adds an index to the soup. |
DataKey |
addObject(java.lang.Object anObject)
Adds the specified object to the soup and returns the key for the new object by which it may be subsequently retrieved. |
protected void |
buildIndex(DataIndex anIndex)
|
DataView |
createView()
Returns an empty data view, suitable for creating new entries in the soup. |
protected abstract boolean |
deleteFile(java.lang.String name)
|
java.util.Collection |
getAllIndices()
Gets a collection of all indices in this soup. |
java.io.File |
getHomeDirectory()
|
protected DataKey |
getNextKey()
|
protected DataKey |
getNextTempKey()
|
java.lang.Object |
getObjectByKey(DataKey aKey)
Gets object from data store whose identifier is equal to the specified object. |
java.lang.Object |
getValueFromObject(java.lang.Object anObject,
java.lang.String aProperty)
|
DataView |
queryByIndex(java.lang.String anIndexName,
java.lang.Object beginKey,
java.lang.Object endKey)
Queries by the specified pre-generated index, if it exists. |
DataView |
queryByKeys(java.util.Collection aKeyList)
Returns a view containing the objects for the specified keys. |
DataView |
queryByProperty(java.lang.String aPropertyName,
java.lang.Object beginKey,
java.lang.Object endKey)
Generates an index based on the specified property and then executes the query. |
DataView |
queryObjects(java.lang.Object beginKey,
java.lang.Object endKey)
Generates an index based on the specified property and then executes the query. |
protected abstract java.lang.Object |
readFile(java.lang.String name)
|
DataKey |
registerTemporaryObject(java.lang.Object anObject)
Registers an object that may or may not be created later, returning a temporary but uniquely identifiable key. |
void |
removeIndex(java.lang.String aName)
Deletes the specified index from the soup. |
java.lang.Object |
removeObject(DataKey aKey)
Removes the specified object from the soup and returns the removed object as read from the soup (which is the original copy of the object). |
DataView |
reverseQueryByIndex(java.lang.String anIndexName,
java.lang.Object beginKey,
java.lang.Object endKey)
As queryByIndex, but with objects returned in reverse order. |
DataView |
reverseQueryByProperty(java.lang.String aPropertyName,
java.lang.Object beginKey,
java.lang.Object endKey)
As queryByProperty, but with objects returned in reverse order. |
DataView |
reverseQueryObjects(java.lang.Object beginKey,
java.lang.Object endKey)
As queryObjects, but with objects returned in reverse order. |
java.lang.Object |
updateObject(DataKey aKey,
java.lang.Object updatedObject)
Updates the specified object and returns the object as updated. |
protected abstract boolean |
writeFile(java.lang.String name,
java.lang.Object anObject)
|
protected void |
writeIndices()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String INDEX_SUFFIX
public static final java.lang.String MAP_SUFFIX
protected DataKey nextUniqueIdentifier
protected java.io.File homeDirectory
protected java.util.Map indices
| Constructor Detail |
|---|
public FileSoup(java.lang.String aPath)
| Method Detail |
|---|
public java.io.File getHomeDirectory()
public void addIndex(java.lang.String aName,
java.lang.String aProperty)
DataSoup
addIndex in interface DataSoupaName - The string identifier for this index.aProperty - The property on which this index will be based.public void removeIndex(java.lang.String aName)
DataSoup
removeIndex in interface DataSoupaName - The string identifier for the index to be removed.public java.util.Collection getAllIndices()
DataSoup
getAllIndices in interface DataSoupprotected void buildIndex(DataIndex anIndex)
protected void writeIndices()
public DataKey registerTemporaryObject(java.lang.Object anObject)
DataSoup
registerTemporaryObject in interface DataSoupanObject - An object to be registered.
public DataKey addObject(java.lang.Object anObject)
addObject in interface DataSoupanObject - Object to be added to soup.
public java.lang.Object removeObject(DataKey aKey)
removeObject in interface DataSoupaKey - A key for an object to be removed.
public java.lang.Object updateObject(DataKey aKey,
java.lang.Object updatedObject)
updateObject in interface DataSoupaKey - A key for an object to be updated.
protected DataKey getNextKey()
protected DataKey getNextTempKey()
public java.lang.Object getObjectByKey(DataKey aKey)
getObjectByKey in interface DataSoupaKey - A key for an object to be retrieved.
public DataView createView()
createView in interface DataSoup
public DataView queryByIndex(java.lang.String anIndexName,
java.lang.Object beginKey,
java.lang.Object endKey)
queryByIndex in interface DataSoupanIndexName - The index to be queried.
public DataView queryByProperty(java.lang.String aPropertyName,
java.lang.Object beginKey,
java.lang.Object endKey)
queryByProperty in interface DataSoupaPropertyName - The property to be queried. If null,
will query the objects directly with queryObjects().
public DataView queryObjects(java.lang.Object beginKey,
java.lang.Object endKey)
queryObjects in interface DataSouppublic DataView queryByKeys(java.util.Collection aKeyList)
queryByKeys in interface DataSoupaKeyList - A collection of keys to be placed in the view.
public DataView reverseQueryByIndex(java.lang.String anIndexName,
java.lang.Object beginKey,
java.lang.Object endKey)
reverseQueryByIndex in interface DataSoupanIndexName - The index to be queried.beginValue - The beginning value, or null for all values
up to an including the end key.endValue - The ending value, or null for all values
since and including the begin key.
public DataView reverseQueryByProperty(java.lang.String aPropertyName,
java.lang.Object beginKey,
java.lang.Object endKey)
reverseQueryByProperty in interface DataSoupaPropertyName - The property to be queried. If null,
will query the objects directly with queryObjects().beginValue - The beginning value, or null for all values
up to an including the end key.endValue - The ending value, or null for all values
since and including the begin key.
public DataView reverseQueryObjects(java.lang.Object beginKey,
java.lang.Object endKey)
reverseQueryObjects in interface DataSoupbeginValue - The beginning value, or null for all values
up to an including the end key.endValue - The ending value, or null for all values
since and including the begin key.
public java.lang.Object getValueFromObject(java.lang.Object anObject,
java.lang.String aProperty)
protected abstract boolean writeFile(java.lang.String name,
java.lang.Object anObject)
protected abstract java.lang.Object readFile(java.lang.String name)
protected abstract boolean deleteFile(java.lang.String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||