|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.tools.cache.Cache<T>
public class Cache<T>
A very simple cache implementation. The cache supports "null" entries.
The cache strategy depends on the samples taken in the CacheEntry.
Constructor Summary | |
---|---|
Cache(int size)
Create a cache with a maximum size of size elements. |
Method Summary | |
---|---|
void |
clear()
Clear all entries in the cache. |
T |
get(java.lang.Object key)
The object with the key "key" or null. |
boolean |
isOutOfSynch()
true if the component is out of synch. |
void |
put(java.lang.Object key,
T value)
Store the object "value" with the key "key" in the cache. |
void |
remove(java.lang.Object key)
Remove an object from the cache. |
protected void |
removeStrategy()
Perform the "cleanup" of the cache. |
int |
size()
The actual size of the cache. |
void |
synch()
Perform a synchronization with the components physical resources. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cache(int size)
size
- The maximum number of elements held in the cache.Method Detail |
---|
public void clear()
public T get(java.lang.Object key)
key
- The key to be used for looking up the cache.
public boolean isOutOfSynch()
ISynchronizable
true
if the component is out of synch.
isOutOfSynch
in interface ISynchronizable
true
if the component is out of synch.public void put(java.lang.Object key, T value)
key
- The key to use for storing the objectvalue
- The value to put in the cache.public void remove(java.lang.Object key)
key
- protected void removeStrategy()
public int size()
public void synch()
ISynchronizable
In case of a scheduled synchronization this may be called by an external daemon.
synch
in interface ISynchronizable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |