leon.data.cache
Class LyObjectCache
java.lang.Object
leon.data.LyCache
leon.data.cache.LyObjectCache
- Direct Known Subclasses:
- LyFullCache, LyNoCache
public abstract class LyObjectCache
- extends LyCache
This class implements a cache that stores objects in memory.
Field Summary |
static java.lang.String |
__VERSION
File version |
Method Summary |
LyObject |
getObjectFromPeer(java.lang.Object peer)
Gets an object from its physical representation (peer). |
int |
getSize(LyFilter filter)
Return the number of objects within this cache that match the given filter (all objects of
the cache if filter is null). |
boolean |
isEmpty()
Tests if this cache is empty or not (contains no object). |
Methods inherited from class leon.data.LyCache |
allowLoaded, clearUnknownIdsCache, contains, contains, getCacheClass, getCount, getEnvironment, getObject, 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
LyObjectCache
public LyObjectCache(LyClass cacheClass,
LyInfoCache policy)
- Constructor of a full cache.
- Parameters:
cacheClass
- Description of the class corresponding to objects stored in this cache.policy
- Description of th epolicy of thsi cache.
getObjectFromPeer
public LyObject getObjectFromPeer(java.lang.Object peer)
- Gets an object from its physical representation (peer). This method is only valid if stored
objects are logical objects (instances of LyObject).
- Specified by:
getObjectFromPeer
in class LyCache
- Parameters:
peer
- Physical representation of the searched object.
- Returns:
- Object with the specified physical representation if it exists, otherwise null.
- Throws:
java.lang.IllegalStateException
- If this cache is not a cache that keep logical objects.
getSize
public int getSize(LyFilter filter)
- Return the number of objects within this cache that match the given filter (all objects of
the cache if filter is null). This method gives objects that are in the cache, no other
objects are loaded.
- Specified by:
getSize
in class LyCache
- Parameters:
filter
- Filter used for selecting objects. If filter is null, the total is returned.
- Returns:
- Number of objects in the cache that match the filter.
isEmpty
public boolean isEmpty()
- Tests if this cache is empty or not (contains no object).
- Specified by:
isEmpty
in class LyCache
- Returns:
- True if the cache is empty, false otherwise.
Website: W4 S.A., contact us: support@w4global.com