|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataContainer
The main internal data structure which stores entries
Method Summary | |
---|---|
void |
clear()
Removes all entries in the container |
boolean |
containsKey(Object k)
Tests whether an entry exists in the container |
Set<InternalCacheEntry> |
entrySet()
Returns a mutable set of immutable cache entries exposed as immutable Map.Entry instances. |
InternalCacheEntry |
get(Object k)
Retrieves a cached entry |
Set<Object> |
keySet()
Returns a set of keys in the container. |
InternalCacheEntry |
peek(Object k)
Retrieves a cache entry in the same way as get(Object) }
except that it does not update or reorder any of the internal constructs. |
void |
purgeExpired()
Purges entries that have passed their expiry time |
void |
put(Object k,
Object v,
long lifespan,
long maxIdle)
Puts an entry in the cache along with a lifespan and a maxIdle time |
InternalCacheEntry |
remove(Object k)
Removes an entry from the cache |
int |
size()
|
Collection<Object> |
values()
|
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
InternalCacheEntry get(Object k)
k
- key under which entry is stored
InternalCacheEntry peek(Object k)
get(Object)
}
except that it does not update or reorder any of the internal constructs.
I.e., expiration does not happen, and in the case of the LRU container,
the entry is not moved to the end of the chain.
This method should be used instead of get(Object)
} when called
while iterating through the data container using methods like keySet()
to avoid changing the underlying collection's order.
k
- key under which entry is stored
void put(Object k, Object v, long lifespan, long maxIdle)
k
- key under which to store entryv
- value to storelifespan
- lifespan in milliseconds. -1 means immortal.maxIdle
- max idle time for which to store entry. -1 means forever.boolean containsKey(Object k)
k
- key to test
InternalCacheEntry remove(Object k)
k
- key to remove
int size()
void clear()
Set<Object> keySet()
#get()
method but instead #peek()
, in order to avoid
changing the order of the underlying collection as a side of effect of iterating through it.
Collection<Object> values()
Set<InternalCacheEntry> entrySet()
void purgeExpired()
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |