1 11 package org.eclipse.jdt.internal.core; 12 13 import java.util.Enumeration ; 14 15 25 public class LRUCacheEnumerator implements Enumeration { 26 29 protected LRUEnumeratorElement fElementQueue; 30 31 public static class LRUEnumeratorElement { 32 35 public Object fValue; 36 37 40 public LRUEnumeratorElement fNext; 41 42 45 public LRUEnumeratorElement(Object value) { 46 fValue = value; 47 } 48 } 49 52 public LRUCacheEnumerator(LRUEnumeratorElement firstElement) { 53 fElementQueue = firstElement; 54 } 55 58 public boolean hasMoreElements() { 59 return fElementQueue != null; 60 } 61 64 public Object nextElement() { 65 Object temp = fElementQueue.fValue; 66 fElementQueue = fElementQueue.fNext; 67 return temp; 68 } 69 } 70 | Popular Tags |