cache.java

来自「Java的面向对象数据库系统的源代码」· Java 代码 · 共 50 行

JAVA
50
字号
// You can redistribute this software and/or modify it under the terms of// the Ozone Core License version 1 published by ozone-db.org.//// Copyright (C) 2003-@year@, Leo Mekenkamp. All rights reserved.//// $Id: Cache.java,v 1.1 2003/12/31 13:51:23 per_nyfelt Exp $package org.ozoneDB.core.storage;import java.util.Collection;import java.util.Map;/** * A cache works a bit like a map. The difference is that for all key-object * pairs put into the cache there is no assurance whatsoever that those * key-object pairs will stay in the cache. * More specifically: given the fact that the last time * the put-method was called for a key K was with value O, then any subsequent * calls to the get-method with key K will either result in object O being * returned, or null. Once a null has been returned for key K, a null value will * always be returned for key K, until K is used again in <code>put()</code>. *  * @author <a href="mailto:leoATmekenkampD0Tcom">Leo Mekenkamp (mind the anti sp@m)</a> * @version $Id: Cache.java,v 1.1 2003/12/31 13:51:23 per_nyfelt Exp $ */public interface Cache {        /**     * Puts an object into the cache, along with its identifying key.     */    public void put(Object key, Object value);        /**     * Returns the object in this cache for the given key.     */    public Object get(Object key);        /**     * Returns the object in this cache for the given key and removes it from     * the cache.     */    public Object remove(Object key);        public Map copyToMap();    public int size();    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?