org.nakedobjects.object
Interface CachePolicy

All Known Implementing Classes:
HashCachePolicy, ThreadCachePolicy

public interface CachePolicy

Interface responsible for caching NakedObjects for a NakedObjectStore.

Author:
Dave Slaughter

Method Summary
 void add(NakedObject object)
          Add a NakedObject to the cache.
 void clear()
          Clear the cache.
 boolean contains(java.lang.Object oid)
          Return true if cache contains an object represented by the OID
 java.lang.String dump()
          Return a String representation of all elements in the cache.
 NakedObject get(java.lang.Object oid)
          Retrieve a NakedObject represented by the supploed oid from the cache.
 void remove(NakedObject object)
          Remove a NakedObject from the cache.
 

Method Detail

add

public void add(NakedObject object)
Add a NakedObject to the cache.

Parameters:
object - the NakedObject to add to the cache

clear

public void clear()
Clear the cache.


contains

public boolean contains(java.lang.Object oid)
Return true if cache contains an object represented by the OID

Parameters:
oid - the OID of the NakedObject

dump

public java.lang.String dump()
Return a String representation of all elements in the cache. Useful for debugging.


get

public NakedObject get(java.lang.Object oid)
Retrieve a NakedObject represented by the supploed oid from the cache.

Parameters:
oid - the OID of the NakedObject to get

remove

public void remove(NakedObject object)
Remove a NakedObject from the cache.

Parameters:
object - the NakedObject to remove