Class ElementCache<K extends IJavaElement & IOpenable>
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.util.LRUCache<K,JavaElementInfo>
org.aspectj.org.eclipse.jdt.internal.core.OverflowingLRUCache<K,JavaElementInfo>
org.aspectj.org.eclipse.jdt.internal.core.ElementCache<K>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
VerboseElementCache
public class ElementCache<K extends IJavaElement & IOpenable>
extends OverflowingLRUCache<K,JavaElementInfo>
An LRU cache of
JavaElements.-
Nested Class Summary
Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.LRUCache
LRUCache.LRUCacheEntry<K,V>, LRUCache.Stats -
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.OverflowingLRUCache
loadFactor, overflow, timestampsOnFields inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.LRUCache
currentSpace, DEFAULT_SPACELIMIT, entryQueue, entryQueueTail, entryTable, spaceLimit, timestampCounter -
Constructor Summary
ConstructorsConstructorDescriptionElementCache(int size) Constructs a new element cache of the given size.ElementCache(int size, int overflow) Constructs a new element cache of the given size. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanclose(LRUCache.LRUCacheEntry<K, JavaElementInfo> entry) Returns true if the element is successfully closed and removed from the cache, otherwise false.protected voidensureSpaceLimit(JavaElementInfo info, IJavaElement parent) protected ElementCache<K> newInstance(int size, int newOverflow) Returns a new instance of the reciever.protected voidresetSpaceLimit(IJavaElement parent) Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.OverflowingLRUCache
clone, elements, fillingRatio, getEntryTable, getLoadFactor, getOverflow, makeSpace, printStats, privateRemoveEntry, privateRemoveEntry, put, remove, setLoadFactor, setSpaceLimit, shrink, toString, updateTimestampMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.LRUCache
flush, flush, get, getCurrentSpace, getKey, getNewestTimestampCounter, getOldestElement, getOldestTimestampCounter, getSpaceLimit, keys, keysAndValues, newInstance, peek, privateAdd, privateAddEntry, removeKey, spaceFor, toStringContents, toStringFillingRation
-
Constructor Details
-
ElementCache
public ElementCache(int size) Constructs a new element cache of the given size. -
ElementCache
public ElementCache(int size, int overflow) Constructs a new element cache of the given size.
-
-
Method Details
-
close
Returns true if the element is successfully closed and removed from the cache, otherwise false.NOTE: this triggers an external removal of this element by closing the element.
- Specified by:
closein classOverflowingLRUCache<K extends IJavaElement & IOpenable,JavaElementInfo>
-
ensureSpaceLimit
-
newInstance
Description copied from class:OverflowingLRUCacheReturns a new instance of the reciever.- Specified by:
newInstancein classOverflowingLRUCache<K extends IJavaElement & IOpenable,JavaElementInfo>
-
resetSpaceLimit
-