|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.toronto.cs.util.caching.AbstractMapCache
edu.toronto.cs.util.caching.UnboundedMapCache
public class UnboundedMapCache
Fairly simplistic unbounded caching.
Field Summary |
---|
Fields inherited from class edu.toronto.cs.util.caching.AbstractMapCache |
---|
cache |
Constructor Summary | |
---|---|
UnboundedMapCache()
Create a new cache. |
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.Object key)
Retrieves a value with the specified key from the cache. |
boolean |
isFull()
Determines if the cache is at its maximum capacity. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Stores a value and assotiates a key with it. |
java.lang.Object |
remove(java.lang.Object key)
Removes a value with the specified key from the cache. |
void |
resize(int size)
Sets the maximum cache size. |
Methods inherited from class edu.toronto.cs.util.caching.AbstractMapCache |
---|
clear, containsKey, containsValue, entrySet, isEmpty, keySet, size, values |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnboundedMapCache()
Method Detail |
---|
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface Cache
put
in class AbstractMapCache
key
- -- the key associated with the value.value
- -- value to store.
public java.lang.Object get(java.lang.Object key)
get
in interface Cache
get
in class AbstractMapCache
key
- -- the key associated with the value.
public java.lang.Object remove(java.lang.Object key)
remove
in interface Cache
remove
in class AbstractMapCache
key
- -- the key associated with the value.
public boolean isFull()
isFull
in class AbstractMapCache
public void resize(int size)
AbstractMapCache
resize
in interface Cache
resize
in class AbstractMapCache
size
- -- the maximum cache size.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |