接口 Cache
- 所有已知实现类:
CacheFIFO,CacheFIFO2,CacheLRU,CacheRandom,GenericCache
public interface Cache
An interface defining the basic functions of a cache.
- 从以下版本开始:
- 1.0
- 版本:
- ,
-
方法概要
修饰符和类型方法说明voidaddElement(Object key, Object value) intcapacity()Returns the maximum number of elements that can be cached at one time.getElement(Object key) intsize()Returns the number of elements in the cache, not to be confused with thecapacity()which returns the number of elements that can be held in the cache at one time.
-
方法详细资料
-
addElement
-
getElement
-
size
int size()Returns the number of elements in the cache, not to be confused with thecapacity()which returns the number of elements that can be held in the cache at one time.- 返回:
- The current size of the cache (i.e., the number of elements currently cached).
-
capacity
int capacity()Returns the maximum number of elements that can be cached at one time.- 返回:
- The maximum number of elements that can be cached at one time.
-