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.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.
22 * <p>The iteration can be made efficient by making use of the fact that values in
23 * the cache (instances of <code>LRUCacheEntry</code>), know their key. For this reason,
24 * Hashtable lookups don't have to be made at each step of the iteration.
26 * <p>Modifications to the cache must not be performed while using the
27 * enumeration. Doing so will lead to an illegal state.
31 public interface ICacheEnumeration extends Enumeration {
33 * Returns the value of the previously accessed key in the enumeration.
34 * Must be called after a call to nextElement().
36 * @return Value of current cache entry
38 public Object getValue();