/*
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.misc;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.NoSuchElementException;
/**
* Caches the collision list.
*/
class CacheEntry extends Ref {
int hash;
Object key;
CacheEntry next;
public Object reconstitute() {
return null;
}
}
/**
* The Cache class. Maps keys to values. Any object can be used as
* a key and/or value. This is very similar to the Hashtable
* class, except that after putting an object into the Cache,
* it is not guaranteed that a subsequent get will return it.
* The Cache will automatically remove entries if memory is
* getting tight and if the entry is not referenced from outside
* the Cache.
*
* To sucessfully store and retrieve objects from a hash table the
* object used as the key must implement the hashCode() and equals()
* methods.
*
* This example creates a Cache of numbers. It uses the names of
* the numbers as keys:
*
* Cache numbers = new Cache();
* numbers.put("one", new Integer(1));
* numbers.put("two", new Integer(1));
* numbers.put("three", new Integer(1));
*
* To retrieve a number use:
*
* Integer n = (Integer)numbers.get("two");
* if (n != null) {
* System.out.println("two = " + n);
* }
*
*
* @see java.lang.Object#hashCode
* @see java.lang.Object#equals
* @see sun.misc.Ref
*/
@Deprecated
public
class Cache extends Dictionary