ozone core API

org.ozoneDB.core.storage
Interface Cache

All Known Subinterfaces:
TrimmingCache
All Known Implementing Classes:
AbstractReferenceCache, AbstractTrimmingCache

public interface Cache

A cache works a bit like a map. The difference is that for all key-object pairs put into the cache there is no assurance whatsoever that those key-object pairs will stay in the cache. More specifically: given the fact that the last time the put-method was called for a key K was with value O, then any subsequent calls to the get-method with key K will either result in object O being returned, or null. Once a null has been returned for key K, a null value will always be returned for key K, until K is used again in put().

Version:
$Id: Cache.java,v 1.1 2003/12/31 13:51:23 per_nyfelt Exp $
Author:
Leo Mekenkamp (mind the anti sp@m)

Method Summary
 java.util.Map copyToMap()
           
 java.lang.Object get(java.lang.Object key)
          Returns the object in this cache for the given key.
 void put(java.lang.Object key, java.lang.Object value)
          Puts an object into the cache, along with its identifying key.
 java.lang.Object remove(java.lang.Object key)
          Returns the object in this cache for the given key and removes it from the cache.
 int size()
           
 

Method Detail

put

public void put(java.lang.Object key,
                java.lang.Object value)
Puts an object into the cache, along with its identifying key.


get

public java.lang.Object get(java.lang.Object key)
Returns the object in this cache for the given key.


remove

public java.lang.Object remove(java.lang.Object key)
Returns the object in this cache for the given key and removes it from the cache.


copyToMap

public java.util.Map copyToMap()

size

public int size()

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.