Class ListParameterization
- java.lang.Object
-
- elki.utilities.optionhandling.parameterization.AbstractParameterization
-
- elki.utilities.optionhandling.parameterization.ListParameterization
-
- All Implemented Interfaces:
Parameterization
public class ListParameterization extends AbstractParameterization
Parameterization handler using a List and OptionIDs, for programmatic use.- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ListParameterization.ParameterPair
Parameter pair, package-private.
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<ListParameterization.ParameterPair>
parameters
The actual parameters, for storage-
Fields inherited from class elki.utilities.optionhandling.parameterization.AbstractParameterization
errors
-
-
Constructor Summary
Constructors Constructor Description ListParameterization()
Default constructor.ListParameterization(java.util.Collection<ListParameterization.ParameterPair> dbParameters)
Constructor with an existing collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListParameterization
addFlag(OptionID optionid)
Add a flag to the parameter listListParameterization
addFlag(java.lang.String optionid)
Add a flag to the parameter listListParameterization
addParameter(OptionID optionid, java.lang.Object value)
Add a parameter to the parameter listprotected ListParameterization
addParameter(ListParameterization.ParameterPair pair)
Add a parameter to the parameter listListParameterization
addParameter(java.lang.String optionid, java.lang.Object value)
Add a parameter to the parameter listListParameterization
descend(java.lang.Object option)
Descend parameterization tree into sub-option.java.util.List<ListParameterization.ParameterPair>
getRemainingParameters()
Return the yet unused parameters.boolean
hasUnusedParameters()
Check for unused parametersjava.util.ArrayList<java.lang.String>
serialize()
Serialize parameters.boolean
setValueForOption(Parameter<?> opt)
Assign a value for an option, but not using default values and throwing exceptions on error.java.lang.String
toString()
-
Methods inherited from class elki.utilities.optionhandling.parameterization.AbstractParameterization
clearErrors, failOnErrors, getErrors, logAndClearReportedErrors, reportError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.utilities.optionhandling.parameterization.Parameterization
grab, hasErrors, tryInstantiate
-
-
-
-
Field Detail
-
parameters
java.util.List<ListParameterization.ParameterPair> parameters
The actual parameters, for storage
-
-
Constructor Detail
-
ListParameterization
public ListParameterization()
Default constructor.
-
ListParameterization
public ListParameterization(java.util.Collection<ListParameterization.ParameterPair> dbParameters)
Constructor with an existing collection.- Parameters:
dbParameters
- existing parameter collection
-
-
Method Detail
-
addFlag
public ListParameterization addFlag(OptionID optionid)
Add a flag to the parameter list- Parameters:
optionid
- Option ID- Returns:
- this, for chaining
-
addFlag
public ListParameterization addFlag(java.lang.String optionid)
Add a flag to the parameter list- Parameters:
optionid
- Option ID- Returns:
- this, for chaining
-
addParameter
public ListParameterization addParameter(OptionID optionid, java.lang.Object value)
Add a parameter to the parameter list- Parameters:
optionid
- Option IDvalue
- Value- Returns:
- this, for chaining
-
addParameter
protected ListParameterization addParameter(ListParameterization.ParameterPair pair)
Add a parameter to the parameter list- Parameters:
pair
- Parameter pair- Returns:
- this, for chaining
-
addParameter
public ListParameterization addParameter(java.lang.String optionid, java.lang.Object value)
Add a parameter to the parameter list- Parameters:
optionid
- Option IDvalue
- Value- Returns:
- this, for chaining
-
setValueForOption
public boolean setValueForOption(Parameter<?> opt) throws ParameterException
Description copied from interface:Parameterization
Assign a value for an option, but not using default values and throwing exceptions on error.- Parameters:
opt
- Parameter to set- Returns:
- Success code
- Throws:
ParameterException
- on assignment errors.
-
getRemainingParameters
public java.util.List<ListParameterization.ParameterPair> getRemainingParameters()
Return the yet unused parameters.- Returns:
- Unused parameters.
-
hasUnusedParameters
public boolean hasUnusedParameters()
Description copied from interface:Parameterization
Check for unused parameters- Returns:
true
if at least one parameter was not consumed
-
descend
public ListParameterization descend(java.lang.Object option)
Description copied from interface:Parameterization
Descend parameterization tree into sub-option.Note: this is done automatically by a
ClassParameter.instantiateClass(elki.utilities.optionhandling.parameterization.Parameterization)
. You only need to call this when you want to expose the tree structure without offering a class choice as parameter.- Parameters:
option
- Option subtree- Returns:
- Parameterization
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
serialize
public java.util.ArrayList<java.lang.String> serialize()
Serialize parameters.- Returns:
- Array list of parameters
-
-