Class UnParameterization
- java.lang.Object
-
- elki.utilities.optionhandling.parameterization.UnParameterization
-
- All Implemented Interfaces:
Parameterization
public class UnParameterization extends java.lang.Object implements Parameterization
Parameterization handler that doesn't set any parameters.This is mostly useful for documentation purposes, listing all parameters in a non-recursive way.
- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<ParameterException>
errors
Errors
-
Constructor Summary
Constructors Constructor Description UnParameterization()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<ParameterException>
getErrors()
Get the configuration errors thrown inParameterization.grab(elki.utilities.optionhandling.parameters.Parameter<?>)
boolean
grab(Parameter<?> opt)
Get the option value from the Parameterization.boolean
hasUnusedParameters()
Check for unused parametersvoid
reportError(ParameterException e)
Report a configuration error.boolean
setValueForOption(Parameter<?> opt)
Assign a value for an option, but not using default values and throwing exceptions on error.-
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, hasErrors, tryInstantiate
-
-
-
-
Field Detail
-
errors
java.util.List<ParameterException> errors
Errors
-
-
Method Detail
-
hasUnusedParameters
public boolean hasUnusedParameters()
Description copied from interface:Parameterization
Check for unused parameters- Specified by:
hasUnusedParameters
in interfaceParameterization
- Returns:
true
if at least one parameter was not consumed
-
getErrors
public java.util.Collection<ParameterException> getErrors()
Description copied from interface:Parameterization
Get the configuration errors thrown inParameterization.grab(elki.utilities.optionhandling.parameters.Parameter<?>)
- Specified by:
getErrors
in interfaceParameterization
- Returns:
- Configuration errors encountered
-
grab
public boolean grab(Parameter<?> opt)
Description copied from interface:Parameterization
Get the option value from the Parameterization.Note: this method returns success; the actual value can be obtained from
opt
itself!In particular
Parameterization.grab(elki.utilities.optionhandling.parameters.Parameter<?>)
can returntrue
whenFlag.getValue()
returnsfalse
! Instead the semantics ofgrab
are those ofParameter#isDefined()
.This method will catch
ParameterException
s and store them to be retrieved byParameterization.getErrors()
.- Specified by:
grab
in interfaceParameterization
- Parameters:
opt
- Option to add- Returns:
- if the value is available (= readable)
-
reportError
public void reportError(ParameterException e)
Description copied from interface:Parameterization
Report a configuration error.- Specified by:
reportError
in interfaceParameterization
- Parameters:
e
- Destination to report errors to
-
setValueForOption
public boolean setValueForOption(Parameter<?> opt)
Description copied from interface:Parameterization
Assign a value for an option, but not using default values and throwing exceptions on error.- Specified by:
setValueForOption
in interfaceParameterization
- Parameters:
opt
- Parameter to set- Returns:
- Success code
-
-