public class DoubleParameter extends NumberParameter<DoubleParameter,Double>
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
Constructor and Description |
---|
DoubleParameter(OptionID optionID)
Constructs a double parameter with the given optionID.
|
DoubleParameter(OptionID optionID,
double defaultValue)
Constructs a double parameter with the given optionID and default value.
|
Modifier and Type | Method and Description |
---|---|
double |
doubleValue()
Get the parameter value as double.
|
String |
getSyntax()
Returns a string representation of the parameter's type.
|
String |
getValueAsString()
Get the value as string.
|
protected Double |
parseValue(Object obj)
Parse a given value into the destination type.
|
addConstraint, getDefaultValue, getDefaultValueAsString, getFullDescription, getGivenValue, getName, getOptionID, getShortDescription, getValue, getValuesDescription, hasDefaultValue, hasValuesDescription, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, useDefaultValue, validate
public DoubleParameter(OptionID optionID, double defaultValue)
optionID
- the unique optionIDdefaultValue
- the default value for this double parameterpublic DoubleParameter(OptionID optionID)
optionID
- the unique id of this parameterpublic String getValueAsString()
Parameter
null
getValueAsString
in interface Parameter<Double>
getValueAsString
in class AbstractParameter<DoubleParameter,Double>
protected Double parseValue(Object obj) throws WrongParameterValueException
AbstractParameter
parseValue
in class AbstractParameter<DoubleParameter,Double>
obj
- Object to parse (may be a string representation!)WrongParameterValueException
public String getSyntax()
getSyntax
in interface Parameter<Double>
getSyntax
in class AbstractParameter<DoubleParameter,Double>
public double doubleValue()