|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.AbstractParameterization de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ChainedParameterization
public class ChainedParameterization
Class that allows chaining multiple parameterizations.
This is designed to allow overriding of some parameters for an algorithm,
while other can be configured via different means, e.g. given by the
user on the command line.
See de.lmu.ifi.dbs.elki.utilities.optionhandling
package documentation
for examples.
Field Summary | |
---|---|
private Vector<Parameterization> |
chain
Keep the list of parameterizations. |
private Parameterization |
errorTarget
Error target |
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.AbstractParameterization |
---|
errors |
Constructor Summary | |
---|---|
ChainedParameterization(Parameterization... ps)
Constructor that takes a number of Parameterizations to chain. |
Method Summary | |
---|---|
void |
appendParameterization(Parameterization p)
Append a new Parameterization to the chain. |
Parameterization |
descend(Object option)
Descend parameterization tree into sub-option. |
void |
errorsTo(Parameterization config)
Set the error target, since there is no unique way where errors can be reported. |
boolean |
hasUnusedParameters()
Check for unused parameters |
void |
reportError(ParameterException e)
Report a configuration error. |
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, reportInternalParameterizationErrors, tryInstantiate, tryInstantiate |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Vector<Parameterization> chain
private Parameterization errorTarget
Constructor Detail |
---|
public ChainedParameterization(Parameterization... ps)
ps
- ParameterizationsMethod Detail |
---|
public void appendParameterization(Parameterization p)
p
- Parameterizationpublic boolean setValueForOption(Parameter<?,?> opt) throws ParameterException
AbstractParameterization
setValueForOption
in interface Parameterization
setValueForOption
in class AbstractParameterization
opt
- Option to be set
ParameterException
- on assignment errors.public boolean hasUnusedParameters()
Parameterization
true
if at least one parameter was not consumedpublic void errorsTo(Parameterization config)
config
- Parameterization to report errors topublic void reportError(ParameterException e)
reportError
in interface Parameterization
reportError
in class AbstractParameterization
e
- Destination to report errors topublic Parameterization descend(Object option)
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.
Parallel descend in all chains.
option
- Option subtree
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |