sizedcache.java
来自「本系统是用 java 语言实现的一个 Email客户端」· Java 代码 · 共 48 行
JAVA
48 行
package net.suberic.util.cache;/** * This represents a cache that will cache objects up to a certain amount * of space. After that space is filled, it will start removing items * using a least recently used algorithm. */public interface SizedCache { /** * Adds an object to the Cache. */ public void add(Object key, Object value); /** * Gets an object from the Cache. If the object is not available, * returns null. */ public Object get(Object key); /** * Removes an object from the Cache. */ public void invalidateCache(Object key); /** * Invalidates the entire cache. */ public void invalidateCache(); /** * Gets the size limit for the cache. */ public long getMaxSize(); /** * Gets the size limit for an individual item in the cache. For obvious * reasons, this should probably not be greater than the max size. */ public long getMaxEntrySize(); /** * Gets the current size of the cache. */ public long getSize();}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?