com.partnersoft.v3x.gadgets
Class SoftCache

java.lang.Object
  extended by com.partnersoft.v3x.gadgets.SoftCache

public abstract class SoftCache
extends java.lang.Object

A basic soft referencecaching implementation based on a hashed index.


Constructor Summary
SoftCache()
          Create a hashed cache.
 
Method Summary
 void clear()
          Clears all items from the cache, so that they must be reloaded.
 java.lang.Object getCached(java.lang.Object index)
           
abstract  java.lang.Object getUncached(java.lang.Object index)
          Subclasses must implement this - it does the "real fetch" of the object, uncached, however appropriate for your use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoftCache

public SoftCache()
Create a hashed cache.

Method Detail

getCached

public java.lang.Object getCached(java.lang.Object index)

getUncached

public abstract java.lang.Object getUncached(java.lang.Object index)
Subclasses must implement this - it does the "real fetch" of the object, uncached, however appropriate for your use. getCached() calls this method when it misses.


clear

public void clear()
Clears all items from the cache, so that they must be reloaded.