public abstract class AbstractParameterization extends Object implements Parameterization
Modifier and Type | Field and Description |
---|---|
(package private) Vector<ParameterException> |
errors
Errors
|
private static Logging |
logger
The logger of the class.
|
Constructor and Description |
---|
AbstractParameterization() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkConstraint(GlobalParameterConstraint constraint)
Check a parameter constraint.
|
void |
clearErrors()
Clear errors.
|
void |
failOnErrors()
Fail on errors, log any error that had occurred.
|
void |
finalize()
Upon destruction, report any errors that weren't handled yet.
|
Collection<ParameterException> |
getErrors()
Get the configuration errors thrown in
Parameterization.grab(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter<?, ?>) |
boolean |
grab(Parameter<?,?> opt)
Get the option value from the Parameterization.
|
boolean |
hasErrors()
Return true when there have been errors.
|
void |
logAndClearReportedErrors()
Log any error that has accumulated.
|
void |
reportError(ParameterException e)
Report a configuration error.
|
void |
reportInternalParameterizationErrors(Parameterization config)
Report the internal parameterization errors to another parameterization
|
abstract boolean |
setValueForOption(Parameter<?,?> opt)
Perform the actual parameter assignment.
|
<C> C |
tryInstantiate(Class<C> c)
Try to instantiate a particular class.
|
<C> C |
tryInstantiate(Class<C> r,
Class<?> c)
Try to instantiate a particular class.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
descend, hasUnusedParameters
Vector<ParameterException> errors
private static final Logging logger
public Collection<ParameterException> getErrors()
Parameterization
Parameterization.grab(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter<?, ?>)
getErrors
in interface Parameterization
public boolean hasErrors()
Parameterization
hasErrors
in interface Parameterization
public void reportError(ParameterException e)
Parameterization
reportError
in interface Parameterization
e
- Destination to report errors topublic void logAndClearReportedErrors()
public void clearErrors()
public void failOnErrors() throws RuntimeException
RuntimeException
- if any error has occurred.public void reportInternalParameterizationErrors(Parameterization config)
config
- Other parameterizationpublic final boolean grab(Parameter<?,?> opt)
Parameterization
opt
itself!
In particular Parameterization.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 ParameterException
s and store them to be
retrieved by Parameterization.getErrors()
.grab
in interface Parameterization
opt
- Option to addpublic abstract boolean setValueForOption(Parameter<?,?> opt) throws ParameterException
setValueForOption
in interface Parameterization
opt
- Option to be setParameterException
- on assignment errors.public void finalize()
public boolean checkConstraint(GlobalParameterConstraint constraint)
Parameterization
checkConstraint
in interface Parameterization
constraint
- Parameter constraintpublic <C> C tryInstantiate(Class<C> r, Class<?> c)
Parameterization
tryInstantiate
in interface Parameterization
C
- return typer
- Restriction classc
- Base classpublic <C> C tryInstantiate(Class<C> c)
Parameterization
tryInstantiate
in interface Parameterization
C
- return typec
- Base class