net.spy.cache
Interface Cachable

All Superinterfaces:
CacheListener
All Known Implementing Classes:
AbstractCachable

public interface Cachable
extends CacheListener

Object that are self-maintaining in a cache.


Method Summary
 int getAccessCount()
          Get the number of times this object has been accessed.
 Object getCachedObject()
          Get the value that has been cached.
 Object getCacheKey()
          Get the key with which this object is cached.
 long getCacheTime()
          Get the timestamp at which this object was cached.
 long getLastAccessTime()
          Get the timestamp of the last access.
 boolean isExpired()
          Determine whether this cache entry has expired.
 void setAccessTime(long t)
          Set the timestamp of a particular access.
 
Methods inherited from interface net.spy.cache.CacheListener
cachedEvent, uncachedEvent
 

Method Detail

getCacheKey

Object getCacheKey()
Get the key with which this object is cached.


getCachedObject

Object getCachedObject()
Get the value that has been cached.


isExpired

boolean isExpired()
Determine whether this cache entry has expired.

Returns:
true if the object has expired

getCacheTime

long getCacheTime()
Get the timestamp at which this object was cached.


getLastAccessTime

long getLastAccessTime()
Get the timestamp of the last access.


setAccessTime

void setAccessTime(long t)
Set the timestamp of a particular access. Implementations are expected to increment their access count and determine whether this particular access time is mroe recent than their current latest access time (which may be the case if the notifications are asynchronous).

Parameters:
t - a timestamp indicating access

getAccessCount

int getAccessCount()
Get the number of times this object has been accessed.



Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.