LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data.cache
Class LyFullCache

java.lang.Object
  extended by leon.data.LyCache
      extended by leon.data.cache.LyObjectCache
          extended by leon.data.cache.LyFullCache

public class LyFullCache
extends LyObjectCache

This class implements a cache that loads completely the instances of the associated class on first access to data.

Normally, this kind of cache is only used for storing logical objects (LyObject).

See Also:
LyObject

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
LyFullCache(LyClass cacheClass, LyInfoCache policy)
          Constructor of a full cache.
 
Method Summary
 void allowLoaded(boolean allowLoaded)
          Setter for the allow loaded attribute.
 int getCount(LyFilter filter)
          Return the number of objects matching the given filter within this cache.
 java.lang.Object getObject(LyObjectId objectId)
          Finds an object in this cache from the specified identifier.
 LyCache.Result getObjects(LyFilter filter, LySimpleObjectList list)
          Adds objects to the given object list that match the specified filter.
 
Methods inherited from class leon.data.cache.LyObjectCache
getObjectFromPeer, getSize, isEmpty
 
Methods inherited from class leon.data.LyCache
clearUnknownIdsCache, contains, contains, getCacheClass, getEnvironment, getObjectList, 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

LyFullCache

public LyFullCache(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

getObject

public java.lang.Object getObject(LyObjectId objectId)
                           throws LyNoSuchObjectException
Finds an object in this cache from the specified identifier. This methods is overriden to force loading if the cache is not loaded.

Overrides:
getObject in class LyCache
Parameters:
objectId - the object if of the wanted object
Returns:
an object
Throws:
LyNoSuchObjectException - if the object is not found

getCount

public int getCount(LyFilter filter)
Return the number of objects matching the given filter within this cache. This methods is overriden to force loading if the cache is not loaded.

Overrides:
getCount in class LyCache
Parameters:
filter - the filter to check
Returns:
a number of obejcts

getObjects

public LyCache.Result getObjects(LyFilter filter,
                                 LySimpleObjectList list)
Adds objects to the given object list that match the specified filter. This methods is overriden to force loading if the cache is not loaded.

Overrides:
getObjects in class LyCache
Parameters:
filter - a filter
list - a list of objects
Returns:
the status of the method

allowLoaded

public void allowLoaded(boolean allowLoaded)
Setter for the allow loaded attribute. For a full cache, allowLoaded is forced to be true;

Specified by:
allowLoaded in class LyCache
Parameters:
allowLoaded - the value of the allowLoaded attribute

(c) January 2013 - W4 S.A.

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