Package org.apache.jackrabbit.core.state
Interface ItemStateCache
-
- All Known Implementing Classes:
ItemStateReferenceCache,MLRUItemStateCache
public interface ItemStateCacheAnItemStateCachemaintains a cache ofItemStateinstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcache(ItemState state)Stores the specifiedItemStateobject in the map using itsItemIdas the key.voiddispose()Informs the cache that it is no longer in use.voidevict(ItemId id)Removes theItemStateobject with the specified id from this cache if it is present.voidevictAll()Clears all entries from this cache.booleanisCached(ItemId id)Returnstrueif this cache contains anItemStateobject with the specifiedid.booleanisEmpty()Returnstrueif this cache contains no entries.ItemStateretrieve(ItemId id)Returns theItemStateobject with the specifiedidif it is present ornullif no entry exists with thatid.ItemState[]retrieveAll()Returns all the cached item states.
-
-
-
Method Detail
-
isCached
boolean isCached(ItemId id)
Returnstrueif this cache contains anItemStateobject with the specifiedid.- Parameters:
id- id ofItemStateobject whose presence should be tested.- Returns:
trueif there's a corresponding cache entry, otherwisefalse.
-
retrieve
ItemState retrieve(ItemId id)
Returns theItemStateobject with the specifiedidif it is present ornullif no entry exists with thatid.- Parameters:
id- the id of theItemStateobject to be returned.- Returns:
- the
ItemStateobject with the specifiedidor ornullif no entry exists with thatid
-
retrieveAll
ItemState[] retrieveAll()
Returns all the cached item states.- Returns:
- newly allocated item state array
-
cache
void cache(ItemState state)
Stores the specifiedItemStateobject in the map using itsItemIdas the key.- Parameters:
state- theItemStateobject to cache
-
evict
void evict(ItemId id)
Removes theItemStateobject with the specified id from this cache if it is present.- Parameters:
id- the id of theItemStateobject which should be removed from this cache.
-
evictAll
void evictAll()
Clears all entries from this cache.
-
isEmpty
boolean isEmpty()
Returnstrueif this cache contains no entries.- Returns:
trueif this cache contains no entries.
-
dispose
void dispose()
Informs the cache that it is no longer in use.
-
-