Package org.apache.jackrabbit.core.state
Interface ItemStateCache
-
- All Known Implementing Classes:
ItemStateReferenceCache
,MLRUItemStateCache
public interface ItemStateCache
AnItemStateCache
maintains a cache ofItemState
instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cache(ItemState state)
Stores the specifiedItemState
object in the map using itsItemId
as the key.void
dispose()
Informs the cache that it is no longer in use.void
evict(ItemId id)
Removes theItemState
object with the specified id from this cache if it is present.void
evictAll()
Clears all entries from this cache.boolean
isCached(ItemId id)
Returnstrue
if this cache contains anItemState
object with the specifiedid
.boolean
isEmpty()
Returnstrue
if this cache contains no entries.ItemState
retrieve(ItemId id)
Returns theItemState
object with the specifiedid
if it is present ornull
if no entry exists with thatid
.ItemState[]
retrieveAll()
Returns all the cached item states.
-
-
-
Method Detail
-
isCached
boolean isCached(ItemId id)
Returnstrue
if this cache contains anItemState
object with the specifiedid
.- Parameters:
id
- id ofItemState
object whose presence should be tested.- Returns:
true
if there's a corresponding cache entry, otherwisefalse
.
-
retrieve
ItemState retrieve(ItemId id)
Returns theItemState
object with the specifiedid
if it is present ornull
if no entry exists with thatid
.- Parameters:
id
- the id of theItemState
object to be returned.- Returns:
- the
ItemState
object with the specifiedid
or ornull
if 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 specifiedItemState
object in the map using itsItemId
as the key.- Parameters:
state
- theItemState
object to cache
-
evict
void evict(ItemId id)
Removes theItemState
object with the specified id from this cache if it is present.- Parameters:
id
- the id of theItemState
object which should be removed from this cache.
-
evictAll
void evictAll()
Clears all entries from this cache.
-
isEmpty
boolean isEmpty()
Returnstrue
if this cache contains no entries.- Returns:
true
if this cache contains no entries.
-
dispose
void dispose()
Informs the cache that it is no longer in use.
-
-