wt.fc.cache
Class ReferenceCache.ObjectReferenceCacheTable.ObjectReferenceCache

java.lang.Object
  extended byjava.util.AbstractMap
      extended bywt.util.Cache
          extended bywt.fc.cache.ReferenceCache.ObjectReferenceCacheTable.ObjectReferenceCache
All Implemented Interfaces:
Map
Enclosing class:
ReferenceCache.ObjectReferenceCacheTable

class ReferenceCache.ObjectReferenceCacheTable.ObjectReferenceCache
extends Cache


Nested Class Summary
 
Nested classes inherited from class wt.util.Cache
Cache.CacheEntry
 
Nested classes inherited from class java.util.AbstractMap
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
(package private)  DirtyMap dirtyMap
           
(package private)  String name
           
 
Fields inherited from class wt.util.Cache
agedOut, cacheSize, count, hashCodes, hits, keys, misses, modCount, tableSize, values
 
Constructor Summary
(package private) ReferenceCache.ObjectReferenceCacheTable.ObjectReferenceCache(int size, String name)
           
 
Method Summary
 void overflow(Object key, Object value)
          Called when an entry is being aged out of the cache.
 Object put(Object key, Object value)
          Put an entry in the cache.
 Object remove(Object key)
          Remove an entry from the cache.
 String toString()
          Returns string representation of the cache.
 
Methods inherited from class wt.util.Cache
clear, containsKey, containsValue, createEntry, entries, entrySet, find, get, getAndRemove, getAndReplace, getKeys, keySet, link, print, size, touch
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

final String name

dirtyMap

final DirtyMap dirtyMap
Constructor Detail

ReferenceCache.ObjectReferenceCacheTable.ObjectReferenceCache

ReferenceCache.ObjectReferenceCacheTable.ObjectReferenceCache(int size,
                                                              String name)
Method Detail

put

public Object put(Object key,
                  Object value)
Description copied from class: Cache
Put an entry in the cache. If an entry for the given key already exists, the previous value is discarded. This entry is considered the most recently used.

Supported API: true

Specified by:
put in interface Map
Overrides:
put in class Cache
Parameters:
key - the entry key
value - the value to associate with the given key
Returns:
The previous value that mapped to the key, or null if there was no previous value

overflow

public void overflow(Object key,
                     Object value)
Description copied from class: Cache
Called when an entry is being aged out of the cache. Can be overriden by subclasses that want to take some action when an entry is being aged out of the cache due to overflow. It is only called when an entry is aged out due to overflow, not when entries are explicitly removed or the cache is cleared. It is called before the entry is removed from the cache.

Overrides:
overflow in class Cache
Parameters:
key - the entry key
value - the entry value

remove

public Object remove(Object key)
Description copied from class: Cache
Remove an entry from the cache. Does nothing if the entry is not currently in the cache.

Supported API: true

Specified by:
remove in interface Map
Overrides:
remove in class Cache
Parameters:
key - the entry key

toString

public String toString()
Description copied from class: Cache
Returns string representation of the cache. The string contains the default string representation of the object plus a summary of the current cache size, hits and misses counts, and aged out entry count.

Supported API: true

Overrides:
toString in class Cache