Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization
Interface Parameterization

All Known Implementing Classes:
AbstractParameterization, ChainedParameterization, EmptyParameterization, ListParameterization, MergedParameterization, SerializedParameterization, TrackParameters, UnParameterization

public interface Parameterization

Interface for object parameterizations.

Author:
Erich Schubert

Method Summary
 boolean checkConstraint(GlobalParameterConstraint constraint)
          Check a parameter constraint.
 Parameterization descend(Parameter<?,?> option)
          Descend parameterization tree into sub-option.
 Collection<ParameterException> getErrors()
          Get the configuration errors thrown in grab(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter)
 boolean grab(Parameter<?,?> opt)
          Get the option value from the Parameterization.
 boolean hasUnusedParameters()
          Check for unused parameters
 void 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.
 

Method Detail

grab

boolean grab(Parameter<?,?> opt)
Get the option value from the Parameterization. Note: this method returns success; the actual value can be obtained from opt itself! In particular grab(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter) can return true when Flag.getValue() returns false! Instead the semantics of grab are those of Parameter#isDefined(). This method will catch ParameterExceptions and store them to be retrieved by getErrors().

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

Collection<ParameterException> getErrors()
Get the configuration errors thrown in grab(de.lmu.ifi.dbs.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:
true if at least one parameter was not consumed

checkConstraint

boolean checkConstraint(GlobalParameterConstraint constraint)
Check a parameter constraint.

Parameters:
constraint - Parameter constraint
Returns:
test result

descend

Parameterization descend(Parameter<?,?> option)
Descend parameterization tree into sub-option. Note: this is done automatically by a ClassParameter.instantiateClass(de.lmu.ifi.dbs.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

Release 0.3 (2010-03-31_1612)