A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / util / ICacheEnumeration.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core.util;
12
13 import java.util.Enumeration;
14
15 /**
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.
21  * 
22  * <p>
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
26  * iteration.
27  * 
28  * <p>
29  * Modifications to the cache must not be performed while using the enumeration.
30  * Doing so will lead to an illegal state.
31  * 
32  * @see LRUCache
33  */
34 public interface ICacheEnumeration extends Enumeration {
35         /**
36          * Returns the value of the previously accessed key in the enumeration. Must
37          * be called after a call to nextElement().
38          * 
39          * @return Value of current cache entry
40          */
41         public Object getValue();
42 }