Package org.jsr166
Enum ConcurrentLinkedHashMap.QueuePolicy
- java.lang.Object
-
- java.lang.Enum<ConcurrentLinkedHashMap.QueuePolicy>
-
- org.jsr166.ConcurrentLinkedHashMap.QueuePolicy
-
- All Implemented Interfaces:
Serializable
,Comparable<ConcurrentLinkedHashMap.QueuePolicy>
- Enclosing class:
- ConcurrentLinkedHashMap<K,V>
public static enum ConcurrentLinkedHashMap.QueuePolicy extends Enum<ConcurrentLinkedHashMap.QueuePolicy>
Defines queue policy for this hash map.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description PER_SEGMENT_Q
Instance ofArrayDeque
is created for each segment.PER_SEGMENT_Q_OPTIMIZED_RMV
Instance ofGridConcurrentLinkedDequeue
is created for each segment.SINGLE_Q
Default policy.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConcurrentLinkedHashMap.QueuePolicy
valueOf(String name)
Returns the enum constant of this type with the specified name.static ConcurrentLinkedHashMap.QueuePolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SINGLE_Q
public static final ConcurrentLinkedHashMap.QueuePolicy SINGLE_Q
Default policy. Single queue is maintained. Iteration order is preserved.
-
PER_SEGMENT_Q
public static final ConcurrentLinkedHashMap.QueuePolicy PER_SEGMENT_Q
Instance ofArrayDeque
is created for each segment. This gives the fastest "natural" evicts for bounded maps.NOTE: Remove operations on map are slower than with other policies.
NOTE: Iteration order is not preserved, i.e. iteration goes as if it was ordinary hash map.
-
PER_SEGMENT_Q_OPTIMIZED_RMV
public static final ConcurrentLinkedHashMap.QueuePolicy PER_SEGMENT_Q_OPTIMIZED_RMV
Instance ofGridConcurrentLinkedDequeue
is created for each segment. This gives faster "natural" evicts for bounded queues and better remove operation times.NOTE: Iteration order is not preserved, i.e. iteration goes as if it was ordinary hash map.
-
-
Method Detail
-
values
public static ConcurrentLinkedHashMap.QueuePolicy[] 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 (ConcurrentLinkedHashMap.QueuePolicy c : ConcurrentLinkedHashMap.QueuePolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConcurrentLinkedHashMap.QueuePolicy 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
-
-