* Creates a new cache. Size of cache is defined by
* <code>DEFAULT_SPACELIMIT</code>.
*/
- public LRUCache() {
-
- this(DEFAULT_SPACELIMIT);
- }
+// public LRUCache() {
+//
+// this(DEFAULT_SPACELIMIT);
+// }
/**
* Creates a new cache.
* @param key
* Key of object to flush
*/
- public void flush(Object key) {
-
- LRUCacheEntry entry;
-
- entry = (LRUCacheEntry) fEntryTable.get(key);
-
- /* If entry does not exist, return */
- if (entry == null)
- return;
-
- this.privateRemoveEntry(entry, false);
- }
+// public void flush(Object key) {
+//
+// LRUCacheEntry entry;
+//
+// entry = (LRUCacheEntry) fEntryTable.get(key);
+//
+// /* If entry does not exist, return */
+// if (entry == null)
+// return;
+//
+// this.privateRemoveEntry(entry, false);
+// }
/**
* Answers the value in the cache at the given key. If the value is not in
* Returns an enumeration that iterates over all the keys and values
* currently in the cache.
*/
- public ICacheEnumeration keysAndValues() {
- return new ICacheEnumeration() {
-
- Enumeration fValues = fEntryTable.elements();
-
- LRUCacheEntry fEntry;
-
- public boolean hasMoreElements() {
- return fValues.hasMoreElements();
- }
-
- public Object nextElement() {
- fEntry = (LRUCacheEntry) fValues.nextElement();
- return fEntry._fKey;
- }
-
- public Object getValue() {
- if (fEntry == null) {
- throw new java.util.NoSuchElementException();
- }
- return fEntry._fValue;
- }
- };
- }
+// public ICacheEnumeration keysAndValues() {
+// return new ICacheEnumeration() {
+//
+// Enumeration fValues = fEntryTable.elements();
+//
+// LRUCacheEntry fEntry;
+//
+// public boolean hasMoreElements() {
+// return fValues.hasMoreElements();
+// }
+//
+// public Object nextElement() {
+// fEntry = (LRUCacheEntry) fValues.nextElement();
+// return fEntry._fKey;
+// }
+//
+// public Object getValue() {
+// if (fEntry == null) {
+// throw new java.util.NoSuchElementException();
+// }
+// return fEntry._fValue;
+// }
+// };
+// }
/**
* Ensures there is the specified amount of free space in the receiver, by
* @param limit
* Number of units of cache space
*/
- public void setSpaceLimit(int limit) {
- if (limit < fSpaceLimit) {
- makeSpace(fSpaceLimit - limit);
- }
- fSpaceLimit = limit;
- }
+// public void setSpaceLimit(int limit) {
+// if (limit < fSpaceLimit) {
+// makeSpace(fSpaceLimit - limit);
+// }
+// fSpaceLimit = limit;
+// }
/**
* Returns the space taken by the given key and value.