|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.Pool<KeyType,ValueType>
KeyType - ValueType - public class Pool<KeyType,ValueType>
Provides a pool of keyed objects and keeps the total size below a given limit. This maps a key to a list of values. The get method is consumptive, it removes the returned value from the list. If the total number of list elements exceed the given cache size this will remove the elements from the list on a key based last used basis
| Constructor Summary | |
|---|---|
Pool(int size)
ctor |
|
| Method Summary | |
|---|---|
void |
clear()
Clear the cache |
boolean |
contains(KeyType key)
_more_ |
boolean |
containsOrCreate(KeyType key)
_more_ |
protected ValueType |
createValue(KeyType key)
_more_ |
ValueType |
get(KeyType key)
_more_ |
protected ValueType |
getFromPool(List<ValueType> list)
_more_ |
Object |
getMutex()
_more_ |
int |
getSize()
_more_ |
void |
getStats(StringBuffer sb)
_more_ |
void |
put(KeyType key,
ValueType value)
_more_ |
protected void |
removeValue(KeyType key,
ValueType object)
_more_ |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Pool(int size)
size - max size| Method Detail |
|---|
public Object getMutex()
public boolean contains(KeyType key)
key - _more_
public ValueType get(KeyType key)
key - _more_
protected ValueType getFromPool(List<ValueType> list)
list - _more_
public boolean containsOrCreate(KeyType key)
key - _more_
public void put(KeyType key,
ValueType value)
key - _more_value - _more_public void getStats(StringBuffer sb)
sb - _more_public void clear()
public int getSize()
protected ValueType createValue(KeyType key)
key - _more_
protected void removeValue(KeyType key,
ValueType object)
key - _more_object - _more_
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||