Enum RangeType
- java.lang.Object
-
- java.lang.Enum<RangeType>
-
- org.faktorips.runtime.internal.tableindex.RangeType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<RangeType>
public enum RangeType extends java.lang.Enum<RangeType>
Defines how the bounds of ranges in aRangeStructureare handled. Ranges in aRangeStructureare defined by only one value. TheRangeTypespecifies whether this value is the upper or lower bound of the range. Ranges may thus be boundless/infinite.Example: In a
LOWER_BOUND_EQUALRangeStructureby callingput(10, value1)andput(25, value2), two ranges are defined: [10..24] and [25..infinity]. When usingUPPER_BOUND_EQUAL, however, the same calls define the ranges [-infinity..10] and [11..25].- See Also:
RangeStructure
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LOWER_BOUNDDeprecated.Because using this type in aRangeStructureresults in asymmetrical behavior of theAbstractMapStructure.put(Object, SearchStructure)andRangeStructure.get(Object)methods.LOWER_BOUND_EQUALIndicates that the keys are meant to be the lower bound of a range including the lower bound.UPPER_BOUNDDeprecated.Because using this type in aRangeStructureresults in asymmetrical behavior of theAbstractMapStructure.put(Object, SearchStructure)andRangeStructure.get(Object)methods.UPPER_BOUND_EQUALIndicates that the keys are meant to be the upper bound of a range including the upper bound.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <K extends java.lang.Comparable<? super K>,V>
java.util.Optional<V>findValue(java.util.TreeMap<K,V> tree, K key)Retrieves the matching value from the given map using the given key.abstract <K extends java.lang.Comparable<? super K>,V>
VgetValue(java.util.TreeMap<K,V> tree, K key)Retrieves the matching value from the given map using the given key.static RangeTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static RangeType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOWER_BOUND
@Deprecated public static final RangeType LOWER_BOUND
Deprecated.Because using this type in aRangeStructureresults in asymmetrical behavior of theAbstractMapStructure.put(Object, SearchStructure)andRangeStructure.get(Object)methods. A value that was added by callingput(10, value)can not be retrieved by callingget(10).Indicates that the keys are meant to be the lower bound of a range (not included).
-
LOWER_BOUND_EQUAL
public static final RangeType LOWER_BOUND_EQUAL
Indicates that the keys are meant to be the lower bound of a range including the lower bound.
-
UPPER_BOUND
@Deprecated public static final RangeType UPPER_BOUND
Deprecated.Because using this type in aRangeStructureresults in asymmetrical behavior of theAbstractMapStructure.put(Object, SearchStructure)andRangeStructure.get(Object)methods. A value that was added by callingput(10, value)can not be retrieved by callingget(10).Indicates that the keys are meant to be the upper bound of a range (not included).
-
UPPER_BOUND_EQUAL
public static final RangeType UPPER_BOUND_EQUAL
Indicates that the keys are meant to be the upper bound of a range including the upper bound.
-
-
Method Detail
-
values
public static RangeType[] 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 (RangeType c : RangeType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RangeType 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 namejava.lang.NullPointerException- if the argument is null
-
getValue
public abstract <K extends java.lang.Comparable<? super K>,V> V getValue(java.util.TreeMap<K,V> tree, K key)Retrieves the matching value from the given map using the given key. The strategy used to retrieve the value depends on the type of key. It differs in how the bounds of ranges are processed.- Returns:
- the matching value in the given
TreeMapornullif no matching value could be found.
-
findValue
public abstract <K extends java.lang.Comparable<? super K>,V> java.util.Optional<V> findValue(java.util.TreeMap<K,V> tree, K key)Retrieves the matching value from the given map using the given key. The strategy used to retrieve the value depends on the type of key. It differs in how the bounds of ranges are processed.- Returns:
- the matching value in the given
TreeMapor anempty Optionalif no matching value could be found.
-
-