|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.semanticdesktop.aperture.accessor.base.FilterAccessData
public abstract class FilterAccessData
Abstract superclass for AccessData implementations that wrap other AccessData instances in order to filter certain information. The abstract class FilterAccessData itself provides default methods that pass requests to the contained AccessData. Subclasses of FilterAccessData should override some of these methods and may also provide additional methods and fields.
Field Summary |
---|
Fields inherited from interface org.semanticdesktop.aperture.accessor.AccessData |
---|
BYTE_SIZE_KEY, DATE_KEY, REDIRECTS_TO_KEY |
Constructor Summary | |
---|---|
FilterAccessData(AccessData accessData)
|
Method Summary | |
---|---|
void |
clear()
Clears this AccessData. |
String |
get(String id,
String key)
Gets specific information about the specified id. |
AccessData |
getAccessData()
|
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 FilterAccessData(AccessData accessData)
Method Detail |
---|
public AccessData getAccessData()
public void clear() throws IOException
AccessData
clear
in interface AccessData
IOException
public String get(String id, String key)
AccessData
get
in interface AccessData
id
- The resource's ID.key
- The info key.
public Set getReferredIDs(String id)
AccessData
getReferredIDs
in interface AccessData
public int getSize()
AccessData
getSize
in interface AccessData
public Set getStoredIDs()
AccessData
getStoredIDs
in interface AccessData
public void initialize() throws IOException
AccessData
initialize
in interface AccessData
IOException
public boolean isKnownId(String id)
AccessData
isKnownId
in interface AccessData
public void put(String id, String key, String value)
AccessData
put
in interface AccessData
id
- The resource's ID.key
- The info key.value
- The info value.public void putReferredID(String id, String referredID)
AccessData
putReferredID
in interface AccessData
id
- The referring resource's ID.referredID
- The referred resource's ID.public void remove(String id, String key)
AccessData
remove
in interface AccessData
id
- A resource ID.key
- A key under which info is stored.public void remove(String id)
AccessData
remove
in interface AccessData
id
- A resource ID.public void removeReferredID(String id, String referredID)
AccessData
removeReferredID
in interface AccessData
id
- The referring resource's ID.referredID
- The referred resource's ID.public void removeReferredIDs(String id)
AccessData
removeReferredIDs
in interface AccessData
id
- The referring resource's ID.public void store() throws IOException
AccessData
store
in interface AccessData
IOException
public Set getAggregatedIDs(String id)
AccessData
getAggregatedIDs
in interface AccessData
AccessData.getAggregatedIDs(java.lang.String)
public ClosableIterator getAggregatedIDsClosure(String id)
AccessData
getAggregatedIDsClosure
in interface AccessData
id
- the id whose aggregation subtree is to be traversed
AccessData.getAggregatedIDsClosure(java.lang.String)
public ClosableIterator getUntouchedIDsIterator()
AccessData
AccessData.initialize()
getUntouchedIDsIterator
in interface AccessData
AccessData.getUntouchedIDsIterator()
public void putAggregatedID(String id, String aggregatedID)
AccessData
AccessData.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 AccessData
id
- the parent idaggregatedID
- the aggregated idAccessData.putAggregatedID(java.lang.String, java.lang.String)
public void removeAggregatedID(String id, String aggregatedID)
AccessData
AccessData.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 AccessData
AccessData.removeAggregatedID(java.lang.String, java.lang.String)
public void removeUntouchedIDs()
AccessData
removeUntouchedIDs
in interface AccessData
AccessData.removeUntouchedIDs()
public void touchRecursively(String id)
AccessData
touchRecursively
in interface AccessData
AccessData.touchRecursively(java.lang.String)
public boolean isTouched(String id)
AccessData
AccessData.initialize()
,
false if the id is not known, or hasn't been touched since the last call to AccessData.initialize()
.
isTouched
in interface AccessData
id
- the id to check
AccessData.isTouched(java.lang.String)
public void touch(String id)
AccessData
AccessData.getUntouchedIDsIterator()
and
will not be removed by AccessData.removeUntouchedIDs()
touch
in interface AccessData
AccessData.touch(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |