1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core.util;
13 import java.util.Enumeration;
16 * The <code>ICacheEnumeration</code> is used to iterate over both the keys
17 * and values in an LRUCache. The <code>getValue()</code> method returns the
18 * value of the last key to be retrieved using <code>nextElement()</code>.
19 * The <code>nextElement()</code> method must be called before the
20 * <code>getValue()</code> method.
23 * The iteration can be made efficient by making use of the fact that values in
24 * the cache (instances of <code>LRUCacheEntry</code>), know their key. For
25 * this reason, Hashtable lookups don't have to be made at each step of the
29 * Modifications to the cache must not be performed while using the enumeration.
30 * Doing so will lead to an illegal state.
34 public interface ICacheEnumeration extends Enumeration {
36 * Returns the value of the previously accessed key in the enumeration. Must
37 * be called after a call to nextElement().
39 * @return Value of current cache entry
41 public Object getValue();