public class IntParameter extends NumberParameter<IntParameter,java.lang.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 |
---|---|
java.lang.String |
getSyntax()
Returns a string representation of the parameter's type.
|
java.lang.String |
getValueAsString()
Get the value as string.
|
int |
intValue()
Get the parameter value as integer
|
protected java.lang.Integer |
parseValue(java.lang.Object obj)
Parse a given value into the destination type.
|
addConstraint, describeValues, getConstraints, getDefaultValue, getDefaultValueAsString, getOptionID, getShortDescription, getValue, hasDefaultValue, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, 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 java.lang.String getValueAsString()
Parameter
null
getValueAsString
in interface Parameter<java.lang.Integer>
getValueAsString
in class AbstractParameter<IntParameter,java.lang.Integer>
protected java.lang.Integer parseValue(java.lang.Object obj) throws ParameterException
AbstractParameter
parseValue
in class AbstractParameter<IntParameter,java.lang.Integer>
obj
- Object to parse (may be a string representation!)ParameterException
- when the object cannot be parsed.public java.lang.String getSyntax()
getSyntax
in interface Parameter<java.lang.Integer>
getSyntax
in class AbstractParameter<IntParameter,java.lang.Integer>
public int intValue()
Copyright © 2019 ELKI Development Team. License information.