Class SerializedParameterization
- java.lang.Object
-
- elki.utilities.optionhandling.parameterization.AbstractParameterization
-
- elki.utilities.optionhandling.parameterization.SerializedParameterization
-
- All Implemented Interfaces:
Parameterization
public class SerializedParameterization extends AbstractParameterization
Manage a parameterization serialized as String array, e.g., from command line.When building parameter lists, use
ListParameterization
where possible.- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OPTION_PREFIX
Prefix of option markers on the command line.(package private) java.util.LinkedList<java.lang.String>
parameters
Parameter storage-
Fields inherited from class elki.utilities.optionhandling.parameterization.AbstractParameterization
errors
-
-
Constructor Summary
Constructors Constructor Description SerializedParameterization()
ConstructorSerializedParameterization(java.lang.String... args)
ConstructorSerializedParameterization(java.util.List<java.lang.String> args)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getRemainingParameters()
Return the yet unused parameters.boolean
hasUnusedParameters()
Check for unused parametersvoid
logUnusedParameters()
Log a warning if there were unused parameters.boolean
setValueForOption(Parameter<?> opt)
Assign a value for an option, but not using default values and throwing exceptions on error.-
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, toString, wait, wait, wait
-
Methods inherited from interface elki.utilities.optionhandling.parameterization.Parameterization
descend, grab, hasErrors, tryInstantiate
-
-
-
-
Field Detail
-
OPTION_PREFIX
public static final java.lang.String OPTION_PREFIX
Prefix of option markers on the command line.The option markers are supposed to be given on the command line with leading
-
.- See Also:
- Constant Field Values
-
parameters
java.util.LinkedList<java.lang.String> parameters
Parameter storage
-
-
Constructor Detail
-
SerializedParameterization
public SerializedParameterization()
Constructor
-
SerializedParameterization
@SafeVarargs public SerializedParameterization(java.lang.String... args)
Constructor- Parameters:
args
- Parameters
-
SerializedParameterization
public SerializedParameterization(java.util.List<java.lang.String> args)
Constructor- Parameters:
args
- Parameter list
-
-
Method Detail
-
getRemainingParameters
public java.util.List<java.lang.String> 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
-
logUnusedParameters
public void logUnusedParameters()
Log a warning if there were unused parameters.
-
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.
-
-