|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.toronto.cs.util.caching.AbstractMapCache
public abstract class AbstractMapCache
Abstract cache class.
Field Summary | |
---|---|
protected java.util.Map |
cache
|
Constructor Summary | |
---|---|
AbstractMapCache(java.util.Map map)
Initializes the AbstractMapCache with a particular Map. |
Method Summary | |
---|---|
void |
clear()
Clears the cache. |
boolean |
containsKey(java.lang.Object key)
Checks whether the cache contains a value associated with the key. |
boolean |
containsValue(java.lang.Object value)
Checks whether the cache contains the specified value. |
java.util.Set |
entrySet()
Returns a Set representation of the mapping. |
abstract java.lang.Object |
get(java.lang.Object key)
Retrieves a value with the specified key from the cache. |
boolean |
isEmpty()
Determines if the cache is empty. |
abstract boolean |
isFull()
Determines if the cache is at its maximum capacity. |
java.util.Set |
keySet()
Gets the set of all the keys registered in the cahce. |
abstract java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Stores a value and assotiates a key with it. |
abstract java.lang.Object |
remove(java.lang.Object key)
Removes a value with the specified key from the cache. |
abstract void |
resize(int size)
Sets the maximum cache size. |
int |
size()
Returns the number of elements in cache. |
java.util.Collection |
values()
Gets a collection view of the values contained in this map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map cache
Constructor Detail |
---|
public AbstractMapCache(java.util.Map map)
Method Detail |
---|
public void clear()
clear
in interface Cache
public boolean containsKey(java.lang.Object key)
containsKey
in interface Cache
key
- -- the key to look for.
public boolean containsValue(java.lang.Object value)
containsValue
in interface Cache
value
- -- the value to look for.
public abstract java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface Cache
key
- -- the key associated with the value.value
- -- value to store.
public abstract java.lang.Object get(java.lang.Object key)
get
in interface Cache
key
- -- the key associated with the value.
public abstract java.lang.Object remove(java.lang.Object key)
remove
in interface Cache
key
- -- the key associated with the value.
public int size()
size
in interface Cache
public boolean isEmpty()
isEmpty
in interface Cache
public abstract boolean isFull()
public java.util.Collection values()
values
in interface Cache
public java.util.Set keySet()
keySet
in interface Cache
public java.util.Set entrySet()
entrySet
in interface Cache
public abstract void resize(int size)
resize
in interface Cache
size
- -- the maximum cache size.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |