接口 Cache

所有已知实现类:
CacheFIFO, CacheFIFO2, CacheLRU, CacheRandom, GenericCache

public interface Cache
An interface defining the basic functions of a cache.
从以下版本开始:
1.0
版本:
,
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    addElement(Object key, Object value)
     
    int
    Returns the maximum number of elements that can be cached at one time.
     
    int
    Returns the number of elements in the cache, not to be confused with the capacity() which returns the number of elements that can be held in the cache at one time.
  • 方法详细资料

    • addElement

      void addElement(Object key, Object value)
    • getElement

      Object getElement(Object key)
    • size

      int size()
      Returns the number of elements in the cache, not to be confused with the capacity() 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.