de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization
Class SerializedParameterization

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.AbstractParameterization
      extended by de.lmu.ifi.dbs.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.


Field Summary
static String OPTION_PREFIX
          Prefix of option markers on the command line.
(package private)  LinkedList<String> parameters
          Parameter storage
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.AbstractParameterization
errors
 
Constructor Summary
SerializedParameterization()
          Constructor
SerializedParameterization(List<String> args)
          Constructor
SerializedParameterization(String[] args)
          Constructor
 
Method Summary
 Parameterization descend(Object option)
          Descend parameterization tree into sub-option.
 List<String> getRemainingParameters()
          Return the yet unused parameters.
 boolean hasUnusedParameters()
          Check for unused parameters
 void logUnusedParameters()
          Log a warning if there were unused parameters.
 boolean setValueForOption(Parameter<?,?> opt)
          Perform the actual parameter assignment.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.AbstractParameterization
checkConstraint, clearErrors, failOnErrors, finalize, getErrors, grab, hasErrors, logAndClearReportedErrors, reportError, reportInternalParameterizationErrors, tryInstantiate, tryInstantiate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_PREFIX

public static final 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

LinkedList<String> parameters
Parameter storage

Constructor Detail

SerializedParameterization

public SerializedParameterization()
Constructor


SerializedParameterization

public SerializedParameterization(String[] args)
Constructor

Parameters:
args - Parameters

SerializedParameterization

public SerializedParameterization(List<String> args)
Constructor

Parameters:
args - Parameter list
Method Detail

getRemainingParameters

public List<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 class: AbstractParameterization
Perform the actual parameter assignment.

Specified by:
setValueForOption in interface Parameterization
Specified by:
setValueForOption in class AbstractParameterization
Parameters:
opt - Option to be set
Returns:
Success code (value available)
Throws:
ParameterException - on assignment errors.

descend

public Parameterization descend(Object 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. Default implementation, for flat parameterizations.

Parameters:
option - Option subtree
Returns:
Parameterization

Release 0.4.0 (2011-09-20_1324)