|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An ItemStateCache
maintains a cache of ItemState
instances.
Method Summary | |
void |
cache(ItemState state)
Stores the specified ItemState object in the map
using its ItemId as the key. |
void |
evict(ItemId id)
Removes the ItemState object with the specified id from
this cache if it is present. |
void |
evictAll()
Clears all entries from this cache. |
boolean |
isCached(ItemId id)
Returns true if this cache contains an ItemState
object with the specified id . |
boolean |
isEmpty()
Returns true if this cache contains no entries. |
Set |
keySet()
Returns an unmodifiable set view of the keys (i.e. |
ItemState |
retrieve(ItemId id)
Returns the ItemState object with the specified
id if it is present or null if no entry exists
with that id . |
int |
size()
Returns the number of entries in this cache. |
Collection |
values()
Returns an unmodifiable collection view of the values (i.e. |
Method Detail |
public boolean isCached(ItemId id)
true
if this cache contains an ItemState
object with the specified id
.
id
- id of ItemState
object whose presence should be
tested.
true
if there's a corresponding cache entry,
otherwise false
.public ItemState retrieve(ItemId id)
ItemState
object with the specified
id
if it is present or null
if no entry exists
with that id
.
id
- the id of the ItemState
object to be returned.
ItemState
object with the specified
id
or or null
if no entry exists
with that id
public void cache(ItemState state)
ItemState
object in the map
using its ItemId
as the key.
state
- the ItemState
object to cachepublic void evict(ItemId id)
ItemState
object with the specified id from
this cache if it is present.
id
- the id of the ItemState
object which should be
removed from this cache.public void evictAll()
public boolean isEmpty()
true
if this cache contains no entries.
true
if this cache contains no entries.public int size()
public Set keySet()
ItemId
objects) of the cached entries.
public Collection values()
ItemState
objects) contained in this cache.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |