Enum Cache.ConcurrentLinkedHashMap.EvictionPolicy

    • Constructor Detail

      • EvictionPolicy

        private EvictionPolicy()
    • Method Detail

      • values

        public static Cache.ConcurrentLinkedHashMap.EvictionPolicy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Cache.ConcurrentLinkedHashMap.EvictionPolicy c : Cache.ConcurrentLinkedHashMap.EvictionPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Cache.ConcurrentLinkedHashMap.EvictionPolicy valueOf​(java.lang.String name)
        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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • 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