| java.lang.Object net.suberic.util.cache.SizedCacheEntry
All known Subclasses: net.suberic.util.cache.FileSizedCacheEntry,
SizedCacheEntry | public class SizedCacheEntry (Code) | | This represents a cached object. It stores the object itself, plus
the size and last accessed time.
|
Constructor Summary | |
public | SizedCacheEntry() Creates a new, empty SizedCacheEntry. | public | SizedCacheEntry(Object value) Creates a new SizedCacheEntry containing value which has been most
recently accessed now. |
Method Summary | |
public boolean | equals(Object o) Compares the underlying value for equality. | public Object | getCachedValue() This gets the cached value. | public long | getLastAccessedTime() Gets the last accessed time for this entry. | public long | getSize() Gets the size of this SizedCacheEntry. | public boolean | removeFromCache() Deletes this entry. | public void | touchEntry() Touches the SizedCacheEntry, making its last accessed time now. |
lastAccessedTime | protected long lastAccessedTime(Code) | | |
SizedCacheEntry | public SizedCacheEntry()(Code) | | Creates a new, empty SizedCacheEntry.
|
SizedCacheEntry | public SizedCacheEntry(Object value)(Code) | | Creates a new SizedCacheEntry containing value which has been most
recently accessed now.
|
equals | public boolean equals(Object o)(Code) | | Compares the underlying value for equality.
|
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.
|
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.
|
touchEntry | public void touchEntry()(Code) | | Touches the SizedCacheEntry, making its last accessed time now.
|
|
|