|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.semanticdesktop.aperture.accessor.base.AccessDataImpl org.semanticdesktop.aperture.accessor.base.FileAccessData
public class FileAccessData
FileAccessData extends AccessDataImpl with functionality for storing the access data to a file and initializing it with the contents of such a file.
Field Summary | |
---|---|
static String |
AGGREGATED_ID_TAG
|
static String |
REFERRED_ID_TAG
|
Fields inherited from class org.semanticdesktop.aperture.accessor.base.AccessDataImpl |
---|
aggregatedIDMap, idMap, referredIDMap |
Fields inherited from interface org.semanticdesktop.aperture.accessor.AccessData |
---|
BYTE_SIZE_KEY, DATE_KEY, REDIRECTS_TO_KEY |
Constructor Summary | |
---|---|
FileAccessData()
Creates a new FileAccessData instance. |
|
FileAccessData(File dataFile)
Creates a new FileAccessData that uses the specified File for persistent storage. |
|
FileAccessData(File dataFile,
int autoSaveInterval)
Creates a new FileAccessData that uses the specified File for persistent storage. |
|
FileAccessData(int autoSaveInterval)
Creates a new FileAccessData instance. |
Method Summary | |
---|---|
void |
clear()
Clears this AccessData. |
String |
get(String id,
String key)
Gets specific information about the specified id. |
int |
getAutoSaveInterval()
|
File |
getDataFile()
|
void |
initialize()
Prepares the AccessData for operation. |
void |
put(String id,
String key,
String value)
Stores information (a key-value pair) for the specified id. |
void |
setAutoSaveInterval(int autoSaveInterval)
Sets the auto save interval. |
void |
setDataFile(File dataFile)
Sets the data File to be used by this FileAccessData. |
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. |
Methods inherited from class org.semanticdesktop.aperture.accessor.base.AccessDataImpl |
---|
getAggregatedIDs, getAggregatedIDsClosure, getReferredIDs, getSize, getStoredIDs, getUntouchedIDsIterator, isKnownId, isTouched, putAggregatedID, putReferredID, remove, remove, removeAggregatedID, removeReferredID, removeReferredIDs, removeUntouchedIDs, touch, touchRecursively |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REFERRED_ID_TAG
public static final String AGGREGATED_ID_TAG
Constructor Detail |
---|
public FileAccessData()
public FileAccessData(File dataFile)
dataFile
- The data file to be used by this FileAccessData.public FileAccessData(int autoSaveInterval)
autoSaveInterval
- the autoSaveInterval, see setAutoSaveInterval(int)
for detailspublic FileAccessData(File dataFile, int autoSaveInterval)
dataFile
- The data file to be used by this FileAccessData.autoSaveInterval
- the autoSaveInterval, see setAutoSaveInterval(int)
for detailsMethod Detail |
---|
public void setDataFile(File dataFile)
dataFile
- The data File to use or 'null' when the FileAccessData is not required (anymore) to
persistently store its access data.public File getDataFile()
public int getAutoSaveInterval()
public void setAutoSaveInterval(int autoSaveInterval)
put(String, String, String)
and get(String, String)
When
this counter reaches the autoSaveInterval value, the store()
method will be called and the
counter will be reset. Each call to this method resets the counter too.
autoSaveInterval
- The new autoSaveInterval value, if set to zero, the autosave feature will be
disabledpublic void put(String id, String key, String value)
AccessData
put
in interface AccessData
put
in class AccessDataImpl
id
- The resource's ID.key
- The info key.value
- The info value.AccessData.put(String, String, String)
public String get(String id, String key)
AccessData
get
in interface AccessData
get
in class AccessDataImpl
id
- The resource's ID.key
- The info key.
AccessData.get(String, String)
public void initialize() throws IOException
AccessData
initialize
in interface AccessData
initialize
in class AccessDataImpl
IOException
AccessData.initialize()
public void store() throws IOException
AccessData
store
in interface AccessData
store
in class AccessDataImpl
IOException
AccessData.store()
public void clear() throws IOException
AccessData
clear
in interface AccessData
clear
in class AccessDataImpl
IOException
AccessData.clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |