org.apache.jackrabbit.core.state
Interface ItemStateCache

All Known Implementing Classes:
ItemStateReferenceCache, MLRUItemStateCache

public interface ItemStateCache

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 dispose()
          Informs the cache that it is no longer in use.
 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.
 void update(ItemId id)
          Informs the cache that the item was modified and the cache might need to recalc the items caching weight.
 Collection values()
          Returns an unmodifiable collection view of the values (i.e.
 

Method Detail

isCached

boolean isCached(ItemId id)
Returns true if this cache contains an ItemState object with the specified id.

Parameters:
id - id of ItemState object whose presence should be tested.
Returns:
true if there's a corresponding cache entry, otherwise false.

retrieve

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.

Parameters:
id - the id of the ItemState object to be returned.
Returns:
the ItemState object with the specified id or or null if no entry exists with that id

cache

void cache(ItemState state)
Stores the specified ItemState object in the map using its ItemId as the key.

Parameters:
state - the ItemState object to cache

evict

void evict(ItemId id)
Removes the ItemState object with the specified id from this cache if it is present.

Parameters:
id - the id of the ItemState object which should be removed from this cache.

evictAll

void evictAll()
Clears all entries from this cache.


isEmpty

boolean isEmpty()
Returns true if this cache contains no entries.

Returns:
true if this cache contains no entries.

size

int size()
Returns the number of entries in this cache.

Returns:
number of entries in this cache.

keySet

Set keySet()
Returns an unmodifiable set view of the keys (i.e. ItemId objects) of the cached entries.

Returns:
a set view of the keys of the cached entries.

values

Collection values()
Returns an unmodifiable collection view of the values (i.e. ItemState objects) contained in this cache.

Returns:
a collection view of the values contained in this cache.

update

void update(ItemId id)
Informs the cache that the item was modified and the cache might need to recalc the items caching weight.

Parameters:
id - the id of the item that was modified.

dispose

void dispose()
Informs the cache that it is no longer in use.



Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.