|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
com.knowgate.cache.ExpireableCache
public class ExpireableCache
This class represents a cache that automatically expires objects when a certain fillness factor is reached.
| Nested Class Summary | |
|---|---|
protected class |
ExpireableCache.MyHeap
Implement a simple heap that just returns the smallest long variable/Object key pair. |
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected java.util.Hashtable |
cache
|
protected int |
capacity
|
protected float |
expire_factor
|
protected int |
hits
|
protected long |
max_keep_alive
|
protected int |
misses
|
protected boolean |
shutdown
|
protected ExpireableCache.MyHeap |
timestamps
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ExpireableCache(int capacity)
|
|
ExpireableCache(int capacity,
float expire_factor,
long max_keep_alive)
|
|
| Method Summary | |
|---|---|
protected void |
expireOver()
|
java.lang.Object |
get(java.lang.Object key)
|
int |
getCapacity()
|
int |
getHits()
|
int |
getMisses()
|
int |
getUsage()
|
void |
hit()
|
void |
miss()
|
void |
put(java.lang.Object key,
java.lang.Object value)
|
void |
remove(java.lang.Object key)
|
void |
run()
|
void |
setCapacity(int size)
|
void |
shutdown()
|
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Hashtable cache
protected ExpireableCache.MyHeap timestamps
protected int capacity
protected float expire_factor
protected int hits
protected int misses
protected boolean shutdown
protected long max_keep_alive
| Constructor Detail |
|---|
public ExpireableCache(int capacity,
float expire_factor,
long max_keep_alive)
public ExpireableCache(int capacity)
| Method Detail |
|---|
public void put(java.lang.Object key,
java.lang.Object value)
public java.lang.Object get(java.lang.Object key)
public void remove(java.lang.Object key)
protected void expireOver()
public void setCapacity(int size)
public int getCapacity()
public int getUsage()
public int getHits()
public int getMisses()
public void hit()
public void miss()
public void shutdown()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||