Interface Parameterization
-
- All Known Implementing Classes:
AbstractParameterization,ChainedParameterization,EmptyParameterization,ListParameterization,MergedParameterization,SerializedParameterization,TrackParameters,UnParameterization
public interface ParameterizationInterface for object parameterizations.See the
elki.utilities.optionhandlingpackage for documentation!- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Parameterizationdescend(java.lang.Object option)Descend parameterization tree into sub-option.java.util.Collection<ParameterException>getErrors()Get the configuration errors thrown ingrab(elki.utilities.optionhandling.parameters.Parameter<?>)default booleangrab(Parameter<?> opt)Get the option value from the Parameterization.default booleanhasErrors()Return true when there have been errors.booleanhasUnusedParameters()Check for unused parametersvoidreportError(ParameterException e)Report a configuration error.booleansetValueForOption(Parameter<?> opt)Assign a value for an option, but not using default values and throwing exceptions on error.default <C> CtryInstantiate(java.lang.Class<C> c)Try to instantiate a particular class.
-
-
-
Method Detail
-
grab
default boolean grab(Parameter<?> opt)
Get the option value from the Parameterization.Note: this method returns success; the actual value can be obtained from
optitself!In particular
grab(elki.utilities.optionhandling.parameters.Parameter<?>)can returntruewhenFlag.getValue()returnsfalse! Instead the semantics ofgrabare those ofParameter#isDefined().This method will catch
ParameterExceptions and store them to be retrieved bygetErrors().- Parameters:
opt- Option to add- Returns:
- if the value is available (= readable)
-
setValueForOption
boolean setValueForOption(Parameter<?> opt) throws ParameterException
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.
-
getErrors
java.util.Collection<ParameterException> getErrors()
Get the configuration errors thrown ingrab(elki.utilities.optionhandling.parameters.Parameter<?>)- Returns:
- Configuration errors encountered
-
reportError
void reportError(ParameterException e)
Report a configuration error.- Parameters:
e- Destination to report errors to
-
hasUnusedParameters
boolean hasUnusedParameters()
Check for unused parameters- Returns:
trueif at least one parameter was not consumed
-
descend
default Parameterization descend(java.lang.Object option)
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
-
hasErrors
default boolean hasErrors()
Return true when there have been errors.- Returns:
- Success code
-
tryInstantiate
default <C> C tryInstantiate(java.lang.Class<C> c)
Try to instantiate a particular class.- Type Parameters:
C- return type- Parameters:
c- Base class- Returns:
- class instance or null
-
-