Package io.timeandspace.smoothie
Enum OptimizationObjective
- java.lang.Object
-
- java.lang.Enum<OptimizationObjective>
-
- io.timeandspace.smoothie.OptimizationObjective
-
- All Implemented Interfaces:
Serializable
,Comparable<OptimizationObjective>
public enum OptimizationObjective extends Enum<OptimizationObjective>
OptimizationObjectives correspond toSmoothieMap
's modes of operation which could be configured viaSmoothieMapBuilder.optimizeFor(io.timeandspace.smoothie.OptimizationObjective)
method.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FOOTPRINT
In the "footprint" mode,SmoothieMap
has the lowest possible footprint per entry and the lowest variability of the footprint at different SmoothieMap's sizes.LOW_GARBAGE
In the "low-garbage" mode,SmoothieMap
generates very little garbage (that is, heap objects that later become unreachable and need to be swept by the GC), either during the growth phase or the shrinkage phase (when a map reduces in size after the peak growth).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OptimizationObjective
valueOf(String name)
Returns the enum constant of this type with the specified name.static OptimizationObjective[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOW_GARBAGE
public static final OptimizationObjective LOW_GARBAGE
In the "low-garbage" mode,SmoothieMap
generates very little garbage (that is, heap objects that later become unreachable and need to be swept by the GC), either during the growth phase or the shrinkage phase (when a map reduces in size after the peak growth).- Implementation Requirements:
- Configuring
smoothieMapBuilder.optimizeFor(LOW_GARBAGE)
includes not allocating intermediate-capacity segments (nor, consequently, splitting between two new segments) and not shrinking SmoothieMap automatically when it reduces in size.
-
FOOTPRINT
public static final OptimizationObjective FOOTPRINT
In the "footprint" mode,SmoothieMap
has the lowest possible footprint per entry and the lowest variability of the footprint at different SmoothieMap's sizes.- Implementation Requirements:
- Configuring
smoothieMapBuilder.optimizeFor(FOOTPRINT)
includes allocating intermediate-capacity segments, splitting between two new segments, and automatic shrinking when a SmoothieMap reduces in size.
-
-
Method Detail
-
values
public static OptimizationObjective[] 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 (OptimizationObjective c : OptimizationObjective.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OptimizationObjective 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
-
-