|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.vdl.router.Cache
public class Cache
| Nested Class Summary | |
|---|---|
class |
Cache.CacheEntry
Interior class to encapsulate cached objects and their additional management keys. |
| Field Summary | |
|---|---|
(package private) Map |
m_cache
remember the objects to cache for. |
(package private) static long[] |
m_stats
Maintains statistics. |
(package private) long |
m_ttl
remember how long to save a cache entry. |
| Constructor Summary | |
|---|---|
Cache(int ttl)
ctor: Initialize the base functionalities of the cache. |
|
| Method Summary | |
|---|---|
Object |
get(Object key)
Requests an item from the cache. |
long[] |
getStatistics()
Requests a copy of the statistics counters. |
Object |
set(Object key,
Object value)
Enters a value into the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
long m_ttl
Map m_cache
static long[] m_stats
| Constructor Detail |
|---|
public Cache(int ttl)
ttl - is the lifetime of a positive entry in seconds.| Method Detail |
|---|
public Object set(Object key,
Object value)
key - is a concise, unique description of the object.value - is the object to be cached.
null for a fresh object, or the old CacheEntry.public Object get(Object key)
key - is the descriptor of the object.public long[] getStatistics()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||