- java.lang.Object
-
- java.lang.Enum<ChunkyList.ShrinkingStrategy>
-
- fr.dufrenoy.util.ChunkyList.ShrinkingStrategy
-
- All Implemented Interfaces:
Serializable,Comparable<ChunkyList.ShrinkingStrategy>
- Enclosing interface:
- ChunkyList<E>
public static enum ChunkyList.ShrinkingStrategy extends Enum<ChunkyList.ShrinkingStrategy>
Strategy used after removing an element from a chunk.UNDERFLOW_STRATEGY— the first element of the next chunk is pulled into the current one; if the chunk is still empty, it is removed.DISAPPEAR_STRATEGY— the chunk is simply removed if it becomes empty.
UNDERFLOW_STRATEGYis the symmetric counterpart ofChunkyList.GrowingStrategy.OVERFLOW_STRATEGY, andDISAPPEAR_STRATEGYis the symmetric counterpart ofChunkyList.GrowingStrategy.EXTEND_STRATEGY. Using a symmetric pair guarantees structural reversibility: inserting and then removing the same element leaves the list in its original state.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DISAPPEAR_STRATEGYThe chunk is simply removed if it becomes empty.UNDERFLOW_STRATEGYThe first element of the next chunk is pulled into the current one; the chunk is removed if still empty.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ChunkyList.ShrinkingStrategyvalueOf(String name)Returns the enum constant of this type with the specified name.static ChunkyList.ShrinkingStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNDERFLOW_STRATEGY
public static final ChunkyList.ShrinkingStrategy UNDERFLOW_STRATEGY
The first element of the next chunk is pulled into the current one; the chunk is removed if still empty.
-
DISAPPEAR_STRATEGY
public static final ChunkyList.ShrinkingStrategy DISAPPEAR_STRATEGY
The chunk is simply removed if it becomes empty.
-
-
Method Detail
-
values
public static ChunkyList.ShrinkingStrategy[] 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 (ChunkyList.ShrinkingStrategy c : ChunkyList.ShrinkingStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ChunkyList.ShrinkingStrategy 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
-
-