Package org.onebusaway.utility
Enum EOutOfRangeStrategy
- java.lang.Object
-
- java.lang.Enum<EOutOfRangeStrategy>
-
- org.onebusaway.utility.EOutOfRangeStrategy
-
- All Implemented Interfaces:
Serializable,Comparable<EOutOfRangeStrategy>
public enum EOutOfRangeStrategy extends Enum<EOutOfRangeStrategy>
Defines the strategy to use when interpolating a key that is outside the key range of the key-value map- Author:
- bdferris
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXCEPTIONAn exception will be thrown when attempting to interpolate a key that is outside the key range of the key-value mapINTERPOLATEAs long as two key-values are present in the map, we we will attempt to interpolate the value for a key that is outside the key range of the key-value map.LAST_VALUEThe closest key-value pair to target key outside the range of the key-value map will be used.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EOutOfRangeStrategyvalueOf(String name)Returns the enum constant of this type with the specified name.static EOutOfRangeStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INTERPOLATE
public static final EOutOfRangeStrategy INTERPOLATE
As long as two key-values are present in the map, we we will attempt to interpolate the value for a key that is outside the key range of the key-value map. If only one key-value pair is present in the map, that value will be used.
-
LAST_VALUE
public static final EOutOfRangeStrategy LAST_VALUE
The closest key-value pair to target key outside the range of the key-value map will be used. This usually corresponds to the first or last key-value pair in the map depending on which end of the key-range the target key is out-of-bounds.
-
EXCEPTION
public static final EOutOfRangeStrategy EXCEPTION
An exception will be thrown when attempting to interpolate a key that is outside the key range of the key-value map
-
-
Method Detail
-
values
public static EOutOfRangeStrategy[] 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 (EOutOfRangeStrategy c : EOutOfRangeStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EOutOfRangeStrategy 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
-
-