/** * create new item * @param hashCode for the entry * @param key <code>Object</code> key * @param value <code>Object</code> value * @param size size in bytes of the item * * subclasses may override to provide their own CacheItem extensions * e.g. one that permits persistence. */ protected CacheItem createItem(int hashCode, Object key, Object value, int size) { return new LruCacheItem(hashCode, key, value, size); }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * create new item * @param hashCode for the entry * @param key <code>Object</code> key * @param value <code>Object</code> value * @param size size in bytes of the item * * subclasses may override to provide their own CacheItem extensions * e.g. one that permits persistence. */ protected CacheItem createItem(int hashCode, Object key, Object value, int size) { return new LruCacheItem(hashCode, key, value, size); }
/** * create new item * @param hashCode for the entry * @param key <code>Object</code> key * @param value <code>Object</code> value * @param size size in bytes of the item * * subclasses may override to provide their own CacheItem extensions * e.g. one that permits persistence. */ protected CacheItem createItem(int hashCode, Object key, Object value, int size) { return new LruCacheItem(hashCode, key, value, size); }
/** * create new item * @param hashCode for the entry * @param key <code>Object</code> key * @param value <code>Object</code> value * @param size size in bytes of the item * * subclasses may override to provide their own CacheItem extensions * e.g. one that permits persistence. */ protected CacheItem createItem(int hashCode, Object key, Object value, int size) { return new LruCacheItem(hashCode, key, value, size); }