org.aspectj.org.eclipse.jdt.internal.core
Class ElementCache

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.util.LRUCache
      extended by org.aspectj.org.eclipse.jdt.internal.core.OverflowingLRUCache
          extended by org.aspectj.org.eclipse.jdt.internal.core.ElementCache
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
VerboseElementCache

public class ElementCache
extends OverflowingLRUCache

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, LRUCache.Stats
 
Field Summary
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.OverflowingLRUCache
loadFactor, overflow, timestampsOn
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.LRUCache
currentSpace, DEFAULT_SPACELIMIT, entryQueue, entryQueueTail, entryTable, spaceLimit, timestampCounter
 
Constructor Summary
ElementCache(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
protected  boolean close(LRUCache.LRUCacheEntry entry)
          Returns true if the element is successfully closed and removed from the cache, otherwise false.
protected  void ensureSpaceLimit(java.lang.Object info, IJavaElement parent)
           
protected  LRUCache newInstance(int size, int newOverflow)
          Returns a new instance of the reciever.
protected  void resetSpaceLimit(int defaultLimit, 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, updateTimestamp
 
Methods 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

close

protected boolean close(LRUCache.LRUCacheEntry entry)
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:
close in class OverflowingLRUCache

ensureSpaceLimit

protected void ensureSpaceLimit(java.lang.Object info,
                                IJavaElement parent)

newInstance

protected LRUCache newInstance(int size,
                               int newOverflow)
Description copied from class: OverflowingLRUCache
Returns a new instance of the reciever.

Specified by:
newInstance in class OverflowingLRUCache

resetSpaceLimit

protected void resetSpaceLimit(int defaultLimit,
                               IJavaElement parent)