Package org.geotools.util.factory
Class Hints.DoubleKey
- Object
-
- RenderingHints.Key
-
- Hints.Key
-
- DoubleKey
-
- Enclosing class:
- Hints
public static final class Hints.DoubleKey extends Hints.Key
A hint used to capture a configuration setting as double. A default value is provided and may be checked withgetDefault()
.- Since:
- 2.6
- Author:
- Jody Garnett
-
-
Constructor Summary
Constructors Constructor Description DoubleKey(double number)
Creates a new key with the specified default value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDefault()
Returns the default value.boolean
isCompatibleValue(Object value)
Returnstrue
if the specified object is a valid integer.double
toValue(Hints hints)
Returns the value from the specified hints as a double.-
Methods inherited from class Hints.Key
getValueClass, toString
-
Methods inherited from class RenderingHints.Key
equals, hashCode, intKey
-
-
-
-
Method Detail
-
getDefault
public double getDefault()
Returns the default value.- Returns:
- The default value.
-
toValue
public double toValue(Hints hints)
Returns the value from the specified hints as a double. If no value were found for this key, then this method returns the default value.- Parameters:
hints
- The map where to fetch the hint value, ornull
.- Returns:
- The hint value as a double, or the default value if not hint was explicitly set.
-
isCompatibleValue
public boolean isCompatibleValue(Object value)
Returnstrue
if the specified object is a valid integer.- Overrides:
isCompatibleValue
in classHints.Key
- Parameters:
value
- The object to test for validity.- Returns:
true
if the value is valid;false
otherwise.- See Also:
Hints.ClassKey.isCompatibleValue(java.lang.Object)
,Hints.FileKey.isCompatibleValue(java.lang.Object)
,Hints.IntegerKey.isCompatibleValue(java.lang.Object)
,Hints.OptionKey.isCompatibleValue(java.lang.Object)
-
-