|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.semanticdesktop.aperture.accessor.base.SynchronizedAccessData
public class SynchronizedAccessData
A synchronized wrapper around an AccessData implementation.
| Field Summary |
|---|
| Fields inherited from interface org.semanticdesktop.aperture.accessor.AccessData |
|---|
BYTE_SIZE_KEY, DATE_KEY, REDIRECTS_TO_KEY |
| Constructor Summary | |
|---|---|
SynchronizedAccessData(AccessData accessData)
The default constructor. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears this AccessData. |
String |
get(String id,
String key)
Gets specific information about the specified id. |
Set |
getAggregatedIDs(String id)
Returns a set of id's that are aggregated immediately below the given one. |
ClosableIterator |
getAggregatedIDsClosure(String id)
Returns an iterator over all ids aggregated within the given one, both directly and indirectly. |
Set |
getReferredIDs(String id)
Returns all referred resources of the specified resource. |
int |
getSize()
Gets the number of resources for which information has been stored in this AccessData. |
Set |
getStoredIDs()
Gets the IDs of all resources for which information has been stored in this AccessData. |
ClosableIterator |
getUntouchedIDsIterator()
Returns an iterator over all ID's in this access data instance that have not been touched since the last call to AccessData.initialize() |
void |
initialize()
Prepares the AccessData for operation. |
boolean |
isKnownId(String id)
Returns whether this AccessData holds any information about the specified ID. |
boolean |
isTouched(String id)
Returns true if this id is known and has been touched since the last call to AccessData.initialize(),
false if the id is not known, or hasn't been touched since the last call to AccessData.initialize(). |
void |
put(String id,
String key,
String value)
Stores information (a key-value pair) for the specified id. |
void |
putAggregatedID(String id,
String aggregatedID)
Puts a link between the given id and the aggregated ID. |
void |
putReferredID(String id,
String referredID)
Stores a reference relation between two resources, modeling e.g. a link. |
void |
remove(String id)
Removes all information about the resource with the specified ID. |
void |
remove(String id,
String key)
Removes the value for the specified id and key. |
void |
removeAggregatedID(String id,
String aggregatedID)
Removes the link between the given id and the aggregated ID. |
void |
removeReferredID(String id,
String referredID)
Removes a reference relationship between two resources. |
void |
removeReferredIDs(String id)
Removes all referred IDs of a resource. |
void |
removeUntouchedIDs()
Removes all untouched IDS |
void |
store()
Informs the AccessData that processing has completed and, in case of a persistent storage, now is a good time to write or flush results. |
void |
touch(String id)
Touches an id. |
void |
touchRecursively(String id)
Recursively touches all ids within the aggregation subtree beginning with the given id |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SynchronizedAccessData(AccessData accessData)
accessData - The access data to be wrapped.| Method Detail |
|---|
public void clear()
throws IOException
AccessData
clear in interface AccessDataIOExceptionAccessData.clear()
public String get(String id,
String key)
AccessData
get in interface AccessDataid - The resource's ID.key - The info key.
AccessData.get(String, String)public Set getReferredIDs(String id)
AccessData
getReferredIDs in interface AccessDataAccessData.getReferredIDs(String)public int getSize()
AccessData
getSize in interface AccessDataAccessData.getSize()public Set getStoredIDs()
AccessData
getStoredIDs in interface AccessDataAccessData.getStoredIDs()
public void initialize()
throws IOException
AccessData
initialize in interface AccessDataIOExceptionAccessData.initialize()public boolean isKnownId(String id)
AccessData
isKnownId in interface AccessDataAccessData.isKnownId(String)
public void put(String id,
String key,
String value)
AccessData
put in interface AccessDataid - The resource's ID.key - The info key.value - The info value.AccessData.put(String, String, String)
public void putReferredID(String id,
String referredID)
AccessData
putReferredID in interface AccessDataid - The referring resource's ID.referredID - The referred resource's ID.AccessData.putReferredID(String, String)
public void remove(String id,
String key)
AccessData
remove in interface AccessDataid - A resource ID.key - A key under which info is stored.AccessData.remove(String,String)public void remove(String id)
AccessData
remove in interface AccessDataid - A resource ID.AccessData.remove(String)
public void removeReferredID(String id,
String referredID)
AccessData
removeReferredID in interface AccessDataid - The referring resource's ID.referredID - The referred resource's ID.AccessData.removeReferredID(String,String)public void removeReferredIDs(String id)
AccessData
removeReferredIDs in interface AccessDataid - The referring resource's ID.AccessData.removeReferredIDs(String)
public void store()
throws IOException
AccessData
store in interface AccessDataIOExceptionAccessData.store()public Set getAggregatedIDs(String id)
AccessData
getAggregatedIDs in interface AccessDataAccessData.getAggregatedIDs(String)public ClosableIterator getAggregatedIDsClosure(String id)
AccessData
getAggregatedIDsClosure in interface AccessDataid - the id whose aggregation subtree is to be traversed
AccessData.getAggregatedIDsClosure(String)public ClosableIterator getUntouchedIDsIterator()
AccessDataAccessData.initialize()
getUntouchedIDsIterator in interface AccessDataAccessData.getUntouchedIDsIterator()
public void putAggregatedID(String id,
String aggregatedID)
AccessDataAccessData.getAggregatedIDsClosure(String)), will be touched by the
AccessData.touchRecursively(String) method, it will be removed if the id is removed (@link
AccessData.remove(String)). Note that the aggregation graph must not contain cycles, each id can have at
most one parent, the implementations are expected to enforce this. If the aggregatedID had a parent
before, the previous link will be removed.
putAggregatedID in interface AccessDataid - the parent idaggregatedID - the aggregated idAccessData.putAggregatedID(String, String)
public void removeAggregatedID(String id,
String aggregatedID)
AccessDataAccessData.getAggregatedIDsClosure(String) and
will not be touched by the AccessData.touchRecursively(String) method. A call to remove the id will not
remove the aggregated id.
removeAggregatedID in interface AccessDataAccessData.removeAggregatedID(String, String)public void removeUntouchedIDs()
AccessData
removeUntouchedIDs in interface AccessDataAccessData.removeUntouchedIDs()public void touchRecursively(String id)
AccessData
touchRecursively in interface AccessDataAccessData.touchRecursively(String)public boolean isTouched(String id)
AccessDataAccessData.initialize(),
false if the id is not known, or hasn't been touched since the last call to AccessData.initialize().
isTouched in interface AccessDataid - the id to check
AccessData.isTouched(java.lang.String)public void touch(String id)
AccessDataAccessData.getUntouchedIDsIterator() and
will not be removed by AccessData.removeUntouchedIDs()
touch in interface AccessDataAccessData.touch(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||