Enum LinkedPolicy.EvictionPolicy
- java.lang.Object
-
- java.lang.Enum<LinkedPolicy.EvictionPolicy>
-
- com.github.benmanes.caffeine.cache.simulator.policy.linked.LinkedPolicy.EvictionPolicy
-
- All Implemented Interfaces:
Serializable,Comparable<LinkedPolicy.EvictionPolicy>
- Enclosing class:
- LinkedPolicy
public static enum LinkedPolicy.EvictionPolicy extends Enum<LinkedPolicy.EvictionPolicy>
The replacement policy.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLOCKEvicts entries based on insertion order, but gives an entry a "second chance" if it has been requested recently.FIFOEvicts entries based on insertion order.LRUEvicts entries based on how recently they are used, with the least recent evicted first.MRUEvicts entries based on how recently they are used, with the most recent evicted first.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringlabel()static LinkedPolicy.EvictionPolicyvalueOf(String name)Returns the enum constant of this type with the specified name.static LinkedPolicy.EvictionPolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FIFO
public static final LinkedPolicy.EvictionPolicy FIFO
Evicts entries based on insertion order.
-
CLOCK
public static final LinkedPolicy.EvictionPolicy CLOCK
Evicts entries based on insertion order, but gives an entry a "second chance" if it has been requested recently.
-
MRU
public static final LinkedPolicy.EvictionPolicy MRU
Evicts entries based on how recently they are used, with the most recent evicted first.
-
LRU
public static final LinkedPolicy.EvictionPolicy LRU
Evicts entries based on how recently they are used, with the least recent evicted first.
-
-
Method Detail
-
values
public static LinkedPolicy.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 (LinkedPolicy.EvictionPolicy c : LinkedPolicy.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 LinkedPolicy.EvictionPolicy valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
label
public String label()
-
-