Class IntListParameter
- java.lang.Object
-
- elki.utilities.optionhandling.parameters.AbstractParameter<P,T>
-
- elki.utilities.optionhandling.parameters.ListParameter<IntListParameter,int[]>
-
- elki.utilities.optionhandling.parameters.IntListParameter
-
- All Implemented Interfaces:
Parameter<int[]>
public class IntListParameter extends ListParameter<IntListParameter,int[]>
Parameter class for a parameter specifying a list of integer values.- Since:
- 0.1
- Author:
- Elke Achtert, Erich Schubert
-
-
Field Summary
-
Fields inherited from class elki.utilities.optionhandling.parameters.ListParameter
LIST_SEP, SPLIT, VECTOR_SEP, VECTOR_SPLIT
-
Fields inherited from class elki.utilities.optionhandling.parameters.AbstractParameter
constraints, defaultValue, givenValue, optionalParameter, optionid
-
-
Constructor Summary
Constructors Constructor Description IntListParameter(OptionID optionID)
Constructs an integer list parameter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDefaultValueAsString()
Get the default value as string.java.lang.String
getSyntax()
Returns a string representation of the parameter's type.java.lang.String
getValueAsString()
Get the value as string.boolean
grab(Parameterization config, java.util.function.Consumer<int[]> consumer)
Get the parameter.protected int[]
parseValue(java.lang.Object obj)
Parse a given value into the destination type.int
size()
Size of the list.-
Methods inherited from class elki.utilities.optionhandling.parameters.AbstractParameter
addConstraint, describeValues, getConstraints, getDefaultValue, getOptionID, getValue, hasDefaultValue, isDefined, isOptional, isValid, setDefaultValue, setOptional, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, validate
-
-
-
-
Constructor Detail
-
IntListParameter
public IntListParameter(OptionID optionID)
Constructs an integer list parameter- Parameters:
optionID
- the unique id of this parameter
-
-
Method Detail
-
getValueAsString
public java.lang.String getValueAsString()
Description copied from interface:Parameter
Get the value as string. May returnnull
- Returns:
- Value as string
-
getDefaultValueAsString
public java.lang.String getDefaultValueAsString()
Description copied from interface:Parameter
Get the default value as string.- Specified by:
getDefaultValueAsString
in interfaceParameter<int[]>
- Overrides:
getDefaultValueAsString
in classAbstractParameter<IntListParameter,int[]>
- Returns:
- default value
-
parseValue
protected int[] parseValue(java.lang.Object obj) throws ParameterException
Description copied from class:AbstractParameter
Parse a given value into the destination type.- Specified by:
parseValue
in classAbstractParameter<IntListParameter,int[]>
- Parameters:
obj
- Object to parse (may be a string representation!)- Returns:
- Parsed object
- Throws:
ParameterException
- when the object cannot be parsed.
-
size
public int size()
Description copied from class:ListParameter
Size of the list.- Specified by:
size
in classListParameter<IntListParameter,int[]>
- Returns:
- Size
-
getSyntax
public java.lang.String getSyntax()
Returns a string representation of the parameter's type.- Returns:
- "<int_1,...,int_n>"
-
grab
public boolean grab(Parameterization config, java.util.function.Consumer<int[]> consumer)
Get the parameter.- Parameters:
config
- Parameterizationconsumer
- Output consumer- Returns:
true
if valid
-
-