public class IntParameter extends NumberParameter<Integer>
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
Constructor and Description |
---|
IntParameter(OptionID optionID)
Constructs an integer parameter with the given optionID.
|
IntParameter(OptionID optionID,
boolean optional)
Deprecated.
Use
AbstractParameter.setOptional(boolean) instead. |
IntParameter(OptionID optionID,
int defaultValue)
Constructs an integer parameter with the given optionID.
|
IntParameter(OptionID optionID,
int defaultValue,
ParameterConstraint<Number> constraint)
|
IntParameter(OptionID optionID,
ParameterConstraint<Number> constraint)
|
IntParameter(OptionID optionID,
ParameterConstraint<Number> constraint,
boolean optional)
|
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, addConstraints, getDefaultValue, getDefaultValueAsString, getFullDescription, getGivenValue, getName, getOptionID, getShortDescription, getValue, getValuesDescription, hasDefaultValue, hasValuesDescription, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, useDefaultValue, validate
@Deprecated public IntParameter(OptionID optionID, int defaultValue, ParameterConstraint<Number> constraint)
AbstractParameter.addConstraint(de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.ParameterConstraint<? super T>)
instead.optionID
- optionID the unique id of the optiondefaultValue
- the default valueconstraint
- the constraint for this integer parameter@Deprecated public IntParameter(OptionID optionID, ParameterConstraint<Number> constraint, boolean optional)
AbstractParameter.addConstraint(de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.ParameterConstraint<? super T>)
instead.optionID
- optionID the unique id of the optionconstraint
- the constraint for this integer parameteroptional
- specifies if this parameter is an optional parameter@Deprecated public IntParameter(OptionID optionID, ParameterConstraint<Number> constraint)
AbstractParameter.addConstraint(de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.ParameterConstraint<? super T>)
instead.optionID
- optionID the unique id of the optionconstraint
- the constraint for this integer parameterpublic IntParameter(OptionID optionID, int defaultValue)
optionID
- optionID the unique id of the optiondefaultValue
- the default value@Deprecated public IntParameter(OptionID optionID, boolean optional)
AbstractParameter.setOptional(boolean)
instead.optionID
- optionID the unique id of the optionoptional
- specifies if this parameter is an optional parameterpublic IntParameter(OptionID optionID)
optionID
- optionID the unique id of the optionpublic String getValueAsString()
Parameter
null
getValueAsString
in interface Parameter<Integer>
getValueAsString
in class AbstractParameter<Integer>
protected Integer parseValue(Object obj) throws ParameterException
AbstractParameter
parseValue
in class AbstractParameter<Integer>
obj
- Object to parse (may be a string representation!)ParameterException
- when the object cannot be parsed.public String getSyntax()
public int intValue()