leon.data.cache
Class LyLruCache
java.lang.Object
leon.data.LyCache
leon.data.cache.LySimpleCache
leon.data.cache.LyLruCache
public class LyLruCache
- extends LySimpleCache
This class implements a LRU (Last recently Used) cache in which objects are stored and unloaded
on the fly, depending to dataSource needs, but n instances are keeped in memory after removing.
Field Summary |
static java.lang.String |
__VERSION
File version |
Constructor Summary |
LyLruCache(LyClass cacheClass,
LyInfoCache policy)
Constructor of a simple cache of objects related to a given class description. |
Method Summary |
java.lang.Object |
getObject(LyObjectId id)
Gets an object in this cache by its identifier. |
Methods inherited from class leon.data.LyCache |
clearUnknownIdsCache, contains, contains, getCacheClass, getCount, getEnvironment, getObjectList, getObjects, getObjects, getPolicy, isLoaded, rehash, setLoaded |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
__VERSION
public static final java.lang.String __VERSION
- File version
- See Also:
- Constant Field Values
LyLruCache
public LyLruCache(LyClass cacheClass,
LyInfoCache policy)
- Constructor of a simple cache of objects related to a given class description.
- Parameters:
cacheClass
- Class description of objects stored in the cache.policy
- Description of th epolicy of thsi cache.
getObject
public java.lang.Object getObject(LyObjectId id)
throws LyNoSuchObjectException
- Gets an object in this cache by its identifier.
- Overrides:
getObject
in class LyCache
- Parameters:
id
- Object identifier.
- Returns:
- Object found in cache with the given identifier, or null if no object is found and
if the id was registered in unknown ids list.
- Throws:
LyNoSuchObjectException
- If no object of this cache has this identifier and if the
given id has not been regsitered in unknown ids list.
Website: W4 S.A., contact us: support@w4global.com