org.xith3d.utility.cache
Interface Cachable<T>

All Superinterfaces:
org.jagatoo.datatypes.NamedObject
All Known Implementing Classes:
NioMemoryBuffer

public interface Cachable<T>
extends org.jagatoo.datatypes.NamedObject

Optional interface which allows the caching system to better report and manage the items being cached.


Method Summary
 void flush(T o)
          Called if the cache determines that the object should be flushed through non-use.
 java.lang.String getName()
           
 long memoryUsed()
           
 

Method Detail

memoryUsed

long memoryUsed()
Returns:
an approximate amount of memory being used by the cached item.

flush

void flush(T o)
Called if the cache determines that the object should be flushed through non-use. This should only be called be the caching system if check in and check out are strictly managed. The the implementation does nothing in this function then the object will be garbaged collected.

Parameters:
o -

getName

java.lang.String getName()
Specified by:
getName in interface org.jagatoo.datatypes.NamedObject
Returns:
the name of the cached object. Returning NULL is acceptable. This is primarily used for reporting and tracking cached items.