/** * get the index of the item given a key * @param key of the entry * @return the index to be used in the cache */ public final int getIndex(Object key) { return getIndex(hash(key)); }
/** * get the item stored at the key. * @param key lookup key * @returns the item stored at the key; null if not found. */ public Object get(Object key) { int hashCode = hash(key); return get(hashCode, key); }
/** * get the index of the item given a key * @param key of the entry * @return the index to be used in the cache */ public final int getIndex(Object key) { return getIndex(hash(key)); }
/** * add the given value to the cache at the specified key * @param key lookup key * @param object item value to be stored */ public void add(Object key, Object value) { int hashCode = hash(key); _put(hashCode, key, value, -1, true); }
/** * cache the given value at the specified key and return previous value * @param key lookup key * @param object item value to be stored * @param size in bytes of the value being cached * @returns the previous item stored at the key; null if not found. */ public Object put(Object key, Object value, int size) { int hashCode = hash(key); return _put(hashCode, key, value, size, false); }
/** * get the index of the item given a key * @param key of the entry * @return the index to be used in the cache */ public final int getIndex(Object key) { return getIndex(hash(key)); }
/** * add the given value with specified size to the cache at specified key * @param key lookup key * @param object item value to be stored * @param size in bytes of the value being added * * This function is suitable for multi-valued keys. */ public void add(Object key, Object value, int size) { int hashCode = hash(key); _put(hashCode, key, value, size, true); }
/** /** * cache the given value at the specified key and return previous value * @param key lookup key * @param object item value to be stored * @returns the previous item stored at the key; null if not found. */ public Object put(Object key, Object value) { int hashCode = hash(key); return _put(hashCode, key, value, -1, false); }
/** * get the item stored at the key. * @param key lookup key * @returns the item stored at the key; null if not found. */ public Object get(Object key) { int hashCode = hash(key); return get(hashCode, key); }
/** /** * cache the given value at the specified key and return previous value * @param key lookup key * @param object item value to be stored * @returns the previous item stored at the key; null if not found. */ public Object put(Object key, Object value) { int hashCode = hash(key); return _put(hashCode, key, value, -1, false); }
/** * get the item stored at the key. * @param key lookup key * @returns the item stored at the key; null if not found. */ public Object get(Object key) { int hashCode = hash(key); return get(hashCode, key); }
/** * cache the given value at the specified key and return previous value * @param key lookup key * @param object item value to be stored * @param size in bytes of the value being cached * @returns the previous item stored at the key; null if not found. */ public Object put(Object key, Object value, int size) { int hashCode = hash(key); return _put(hashCode, key, value, size, false); }
/** * add the given value to the cache at the specified key * @param key lookup key * @param object item value to be stored */ public void add(Object key, Object value) { int hashCode = hash(key); _put(hashCode, key, value, -1, true); }
/** * add the given value to the cache at the specified key * @param key lookup key * @param object item value to be stored */ public void add(Object key, Object value) { int hashCode = hash(key); _put(hashCode, key, value, -1, true); }
/** * cache the given value at the specified key and return previous value * @param key lookup key * @param object item value to be stored * @param size in bytes of the value being cached * @returns the previous item stored at the key; null if not found. */ public Object put(Object key, Object value, int size) { int hashCode = hash(key); return _put(hashCode, key, value, size, false); }
/** * add the given value to the cache at the specified key * @param key lookup key * @param object item value to be stored */ public void add(Object key, Object value) { int hashCode = hash(key); _put(hashCode, key, value, -1, true); }
/** * cache the given value at the specified key and return previous value * @param key lookup key * @param object item value to be stored * @param size in bytes of the value being cached * @returns the previous item stored at the key; null if not found. */ public Object put(Object key, Object value, int size) { int hashCode = hash(key); return _put(hashCode, key, value, size, false); }
/** * add the given value with specified size to the cache at specified key * @param key lookup key * @param object item value to be stored * @param size in bytes of the value being added * * This function is suitable for multi-valued keys. */ public void add(Object key, Object value, int size) { int hashCode = hash(key); _put(hashCode, key, value, size, true); }
/** /** * cache the given value at the specified key and return previous value * @param key lookup key * @param object item value to be stored * @returns the previous item stored at the key; null if not found. */ public Object put(Object key, Object value) { int hashCode = hash(key); return _put(hashCode, key, value, -1, false); }
/** * remove the item stored at the key. * @param key lookup key * @returns the item stored at the key; null if not found. */ public Object remove(Object key) { int hashCode = hash(key); Object retVal = null; CacheItem removed = _remove( hashCode, key, null); if (removed != null) retVal = removed.getValue(); return retVal; }