public class IntParameter extends NumberParameter<IntParameter,Integer>
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
Constructor and Description |
---|
IntParameter(OptionID optionID)
Constructs an integer parameter with the given optionID.
|
IntParameter(OptionID optionID,
int defaultValue)
Constructs an integer parameter with the given optionID.
|
Modifier and Type | Method and Description |
---|---|
String |
getSyntax()
Returns a string representation of the parameter's type.
|
String |
getValueAsString()
Get the value as string.
|
int |
intValue()
Get the parameter value as integer
|
protected Integer |
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 IntParameter(OptionID optionID, int defaultValue)
optionID
- optionID the unique id of the optiondefaultValue
- the default valuepublic IntParameter(OptionID optionID)
optionID
- optionID the unique id of the optionpublic String getValueAsString()
Parameter
null
getValueAsString
in interface Parameter<Integer>
getValueAsString
in class AbstractParameter<IntParameter,Integer>
protected Integer parseValue(Object obj) throws ParameterException
AbstractParameter
parseValue
in class AbstractParameter<IntParameter,Integer>
obj
- Object to parse (may be a string representation!)ParameterException
- when the object cannot be parsed.public String getSyntax()
getSyntax
in interface Parameter<Integer>
getSyntax
in class AbstractParameter<IntParameter,Integer>
public int intValue()