Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


oracle.javatools.util
Class Maps.BoundedLruCacheStrategy<K,V>

java.lang.Object
  extended by oracle.javatools.util.Maps.CacheStrategy<K,V>
      extended by oracle.javatools.util.Maps.BoundedLruCacheStrategy<K,V>

All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Maps.TimedLruCacheStrategy
Enclosing class:
Maps

public static class Maps.BoundedLruCacheStrategy<K,V>
extends Maps.CacheStrategy<K,V>

A bounded size LRU (least recently used) cache strategy.

See Also:
Maps.CacheMap, Maps.CacheStrategy, Serialized Form

Field Summary

 

Fields inherited from class oracle.javatools.util.Maps.CacheStrategy
CANONICAL, DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, HARD, NONCANONICAL, NOT_CANONICAL, SOFT, STRONG, WEAK

 

Constructor Summary
Maps.BoundedLruCacheStrategy(int bound)
          Constructs a bounded LRU (least recently used), canonical, cache strategy of strongly-referenced values.
Maps.BoundedLruCacheStrategy(int bound, int initialCapacity, float loadFactor, Maps.CacheMap.Canonicity canonicity, Maps.CacheMap.Strength strength)
          Constructs a bounded LRU (least recently used) cache strategy.
Maps.BoundedLruCacheStrategy(int bound, Maps.CacheMap.Canonicity canonicity, Maps.CacheMap.Strength strength)
          Constructs a bounded LRU (least recently used) cache strategy.
Maps.BoundedLruCacheStrategy(int bound, Maps.CacheMap.Strength strength)
          Constructs a bounded LRU (least recently used), canonical cache strategy.

 

Method Summary
protected  void entryAdded(Maps.CacheMap<K,V> map, Maps.LinkedEntry<K,V> entry)
          Invoked when a new entry is added to this map, when entries are added by Maps.AbstractHashMap.put(K, V).

 

Methods inherited from class oracle.javatools.util.Maps.CacheStrategy
createDefaultEntry, createEntry, createEvictedEntry, createSoftEntry, createWeakEntry, entryAccessed, entryChanged, entryEvicted, entryPurged, entryRemoved, getCanonicity, getDefaultStrength, getInitialCapacity, getLoadFactor, mapChanged, mapConstructed

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Maps.BoundedLruCacheStrategy

public Maps.BoundedLruCacheStrategy(int bound)
Constructs a bounded LRU (least recently used), canonical, cache strategy of strongly-referenced values. The initial capacity and load factor are set to maximumSize+1 and 1.0f, respectively, which ensures that the map will not have to resize before reaching its maximum size.
Parameters:
bound - The maximum number of entries allowed in the cache.

Maps.BoundedLruCacheStrategy

public Maps.BoundedLruCacheStrategy(int bound,
                                    Maps.CacheMap.Strength strength)
Constructs a bounded LRU (least recently used), canonical cache strategy. The initial capacity and load factor are set to maximumSize+1 and 1.0f, respectively, which ensures that the map will not have to resize before reaching its maximum size.
Parameters:
bound - The maximum number of entries allowed in the cache.
strength - The strength of value references.

Maps.BoundedLruCacheStrategy

public Maps.BoundedLruCacheStrategy(int bound,
                                    Maps.CacheMap.Canonicity canonicity,
                                    Maps.CacheMap.Strength strength)
Constructs a bounded LRU (least recently used) cache strategy. The initial capacity and load factor are set to maximumSize+1 and 1.0f, respectively, which ensures that the map will not have to resize before reaching its maximum size.
Parameters:
bound - The maximum number of entries allowed in the cache.
canonicity - The mapping type, canonical or not.
strength - The strength of value references.

Maps.BoundedLruCacheStrategy

public Maps.BoundedLruCacheStrategy(int bound,
                                    int initialCapacity,
                                    float loadFactor,
                                    Maps.CacheMap.Canonicity canonicity,
                                    Maps.CacheMap.Strength strength)
Constructs a bounded LRU (least recently used) cache strategy.
Parameters:
bound - The maximum number of entries allowed in the cache.
initialCapacity - The initial capacity (see Maps.CacheStrategy.DEFAULT_INITIAL_CAPACITY).
loadFactor - The load factor (see Maps.CacheStrategy.DEFAULT_LOAD_FACTOR).
canonicity - The mapping type, canonical or not.
strength - The strength of value references.

Method Detail

entryAdded

protected void entryAdded(Maps.CacheMap<K,V> map,
                          Maps.LinkedEntry<K,V> entry)
Invoked when a new entry is added to this map, when entries are added by Maps.AbstractHashMap.put(K, V).

The Maps.CacheStrategy implementation does nothing.

The Maps.BoundedLruCacheStrategy implementation evicts the eldest entry in the map if the size of the map after the add exceeds the maximum size.

Overrides:
entryAdded in class Maps.CacheStrategy<K,V>

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


Copyright © 1997, 2015, Oracle. All rights reserved.