LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data.cache
Class LyObjectCache

java.lang.Object
  extended by leon.data.LyCache
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class leon.data.LyCache
LyCache.Result
 
Field Summary
static java.lang.String __VERSION
          File version
 
Fields inherited from class leon.data.LyCache
NB_UNKNOWN_OBJECTS
 
Constructor Summary
LyObjectCache(LyClass cacheClass, LyInfoCache policy)
          Constructor of a full cache.
 
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
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

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.
Method Detail

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.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com