public final class Cache extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
Cache.InconsistencyException
Thrown if one or more problems are discovered with cache consistency.
|
class |
Cache.Info
A class which enables reporting upon the state of the
Cache. |
| Constructor and Description |
|---|
Cache(int maxSize)
Constructor with maximum size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Object key)
Remove from cache.
|
void |
dump()
Output to syserr.
|
void |
dumpAnalysis()
Dump to Syserr.
|
Object |
get(Object key)
Return an object from the Cache, null if not found.
|
Cache.Info |
getInfo() |
Enumeration<Object> |
getReport()
Report on the status of the cache.
|
int |
getSize()
Get maximum size of Cache.
|
void |
iterate(Procedure f)
Apply function to all items in cache, only ignoring items
where the value has been garbage collected.
|
void |
put(Object key,
Object value)
Add an Object to the cache.
|
void |
setSize(int maxSize)
Set maximum size of Cache.
|
void |
trim(int maxSize_P)
Reduce number of units held in the cache, without changing
its size.
|
public Cache(int maxSize)
maxSize - maximum size cache may grow topublic void setSize(int maxSize)
maxSize - maximum size cache may grow topublic int getSize()
public void trim(int maxSize_P)
maxSize_P - maximum number of units to holdpublic void delete(Object key)
key - cache key fieldpublic void put(Object key, Object value)
key - the Object to use as a lookupvalue - the Object to put in the cachepublic Object get(Object key)
key - the cache keypublic void iterate(Procedure f)
f - Procedure to apply to all members of cachepublic Enumeration<Object> getReport()
public Cache.Info getInfo()
public void dumpAnalysis()
public void dump()
Copyright © 2000–2021 PanEris. All rights reserved.