SimpleLRUDVOCacher¶
-
public class
SimpleLRUDVOCacher
extends Component implements DVOCacher¶ The
SimpleLRUDVOCacher
is the simple DVO cacher which possess LRU, Least-Recently Used features. When there is not enough room to store the DVO as a cache. It tries to remove the oldest record (the one that has not retrieved for longest times). Creation Date: 12/2/2007Author: Twinsen Tsang
Constructors¶
SimpleLRUDVOCacher¶
-
public
SimpleLRUDVOCacher
()¶ Constructor. Use
SimpleLRUDVOCacher(int)
instead of this constructor. This is reserved for Piazza Common component initialization only.
Methods¶
activeSize¶
-
public int
activeSize
()¶ The activs size is defined how many DVO are already stored in the cacher.
Returns: Get the active size of DVO cacher.
efficieny¶
-
public double
efficieny
()¶ This method is used to calculate the
getDVO(String)
efficieny (eff) of the cacher. It is formulated :cacheHit eff = (--------------------) * 100 cacheHit + cacheMiss
Returns: the efficiency of the cacher.
getDVO¶
maxSize¶
-
public int
maxSize
()¶ The maximum size is defined how many DVO are the cacher can store before swapping out happens.
Returns: Get the maximum size of DVO cacher.
putDVO¶
-
public void
putDVO
(String key, DVO cacheItem)¶ Store the DVO
cacheItem
into the cacher with the specifiedKey
. If the DVO in thekey
is already exist, it throws CacheException indicating cache duplication.Parameters: - key – The key field of the DVO.
- cacheItem – The DVO item to be cached.
Throws: - CacheException – when the record is already exist.
See also:
.putOrUpdateDVO(String,DVO);