| java.lang.Object net.suberic.util.cache.SizedCacheEntry net.suberic.util.cache.FileSizedCacheEntry
FileSizedCacheEntry | public class FileSizedCacheEntry extends SizedCacheEntry (Code) | | This represents a cached object. It stores the object itself, plus
the size and last accessed time.
This implementation uses files to store the information in the cache.
|
Constructor Summary | |
public | FileSizedCacheEntry(Object value, boolean create, String filename) Creates a new FileSizedCacheEntry containing value which has been most
recently accessed now. |
lastAccessedTime | protected long lastAccessedTime(Code) | | |
FileSizedCacheEntry | public FileSizedCacheEntry(Object value, boolean create, String filename)(Code) | | Creates a new FileSizedCacheEntry containing value which has been most
recently accessed now.
|
equals | public boolean equals(Object o)(Code) | | Compares the underlying value for equality.
|
getCacheFile | public File getCacheFile()(Code) | | Gets the File object for the cache.
|
getCachedValue | public Object getCachedValue()(Code) | | This gets the cached value. Implementations may vary for this.
|
getLastAccessedTime | public long getLastAccessedTime()(Code) | | Gets the last accessed time for this entry.
|
getSize | public long getSize()(Code) | | Gets the size of this SizedCacheEntry.
|
loadValue | public Object loadValue() throws IOException(Code) | | Loads the given value from the source file.
Note that this should also set the size.
|
removeFromCache | public boolean removeFromCache()(Code) | | Deletes this entry. Should be called in order to clean up entries
for which simple removal from memory is insufficient.
The default implementation does nothing; subclasses should override
this method if cleanup is required.
|
saveValue | public void saveValue(File f, Object value) throws IOException(Code) | | Saves the given value to the source file.
Note that this should also set the size.
|
touchEntry | public void touchEntry()(Code) | | Touches the SizedCacheEntry, making its last accessed time now.
|
|
|