|
||||||||||
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
public abstract class AbstractParameterization
Abstract class with shared code for parameterization handling.
Field Summary | |
---|---|
(package private) Vector<ParameterException> |
errors
Errors |
private static Logging |
logger
The logger of the class. |
Constructor Summary | |
---|---|
AbstractParameterization()
|
Method Summary | ||
---|---|---|
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. |
|
|
tryInstantiate(Class<C> c)
Try to instantiate a particular class. |
|
|
tryInstantiate(Class<C> r,
Class<?> c)
Try to instantiate a particular class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization |
---|
descend, hasUnusedParameters |
Field Detail |
---|
Vector<ParameterException> errors
private static final Logging logger
Constructor Detail |
---|
public AbstractParameterization()
Method Detail |
---|
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 add
public abstract boolean setValueForOption(Parameter<?,?> opt) throws ParameterException
setValueForOption
in interface Parameterization
opt
- Option to be set
ParameterException
- on assignment errors.public void finalize()
finalize
in class Object
public boolean checkConstraint(GlobalParameterConstraint constraint)
Parameterization
checkConstraint
in interface Parameterization
constraint
- Parameter constraint
public <C> C tryInstantiate(Class<C> r, Class<?> c)
Parameterization
tryInstantiate
in interface Parameterization
C
- return typer
- Restriction classc
- Base class
public <C> C tryInstantiate(Class<C> c)
Parameterization
tryInstantiate
in interface Parameterization
C
- return typec
- Base class
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |