Enum Cache.ConcurrentLinkedHashMap.EvictionPolicy

java.lang.Object
java.lang.Enum<Cache.ConcurrentLinkedHashMap.EvictionPolicy>
gw.util.concurrent.Cache.ConcurrentLinkedHashMap.EvictionPolicy
All Implemented Interfaces:
Serializable, Comparable<Cache.ConcurrentLinkedHashMap.EvictionPolicy>, java.lang.constant.Constable
Enclosing class:
Cache.ConcurrentLinkedHashMap<K,V>

public static enum Cache.ConcurrentLinkedHashMap.EvictionPolicy extends Enum<Cache.ConcurrentLinkedHashMap.EvictionPolicy>
The replacement policy to apply to determine which entry to discard to when the capacity has been reached.
  • Enum Constant Details

  • Constructor Details

    • EvictionPolicy

      private EvictionPolicy()
  • Method Details

    • values

      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • onGet

      abstract <K, V> void onGet(Cache.ConcurrentLinkedHashMap<K,V> map, Cache.ConcurrentLinkedHashMap.Node<K,V> node)
      Performs any operations required by the policy after a node was successfully retrieved.
      Parameters:
      map - the map to for this listener
      node - the specific node
    • onRemove

      <K, V> void onRemove(Cache.ConcurrentLinkedHashMap<K,V> map, Cache.ConcurrentLinkedHashMap.Node<K,V> node)
      Expires a node so that, for all intents and purposes, it is a dead on the list. The caller of this method should have already removed the node from the mapping so that no key can look it up. When the node reaches the head of the list it will be evicted.
      Parameters:
      map - the map to for this listener
      node - the specific node
    • onEvict

      abstract <K, V> boolean onEvict(Cache.ConcurrentLinkedHashMap<K,V> map, Cache.ConcurrentLinkedHashMap.Node<K,V> node)
      Determines whether to evict the node at the head of the list. If false, the node is offered to the tail.
      Parameters:
      map - the map to for this listener
      node - the specific node
      Returns:
      whether this node is to be evicted