public class TrackParameters extends java.lang.Object implements Parameterization
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> |
children
Tree information: child links
|
(package private) Parameterization |
inner
Inner parameterization
|
(package private) java.util.List<TrackedParameter> |
options
Tracking storage
|
(package private) java.lang.Object |
owner
Current parent for nested parameterization
|
(package private) java.util.Map<java.lang.Object,java.lang.Object> |
parents
Tree information: parent links
|
Modifier | Constructor and Description |
---|---|
|
TrackParameters(Parameterization inner)
Constructor.
|
|
TrackParameters(Parameterization inner,
java.lang.Object owner)
Constructor.
|
private |
TrackParameters(Parameterization inner,
java.lang.Object owner,
java.util.List<TrackedParameter> options,
java.util.Map<java.lang.Object,java.lang.Object> parents,
java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> children)
Internal constructor, for nested tracking.
|
Modifier and Type | Method and Description |
---|---|
Parameterization |
descend(java.lang.Object option)
Descend parameterization tree into sub-option.
|
java.util.Collection<TrackedParameter> |
getAllParameters()
Get all seen parameters, set or unset, along with their owner objects.
|
java.util.Collection<ParameterException> |
getErrors()
Get the configuration errors thrown in
Parameterization.grab(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter<?>) |
java.lang.Object |
getParent(java.lang.Object pos)
Traverse the tree upwards.
|
boolean |
grab(Parameter<?> opt)
Get the option value from the Parameterization.
|
boolean |
hasUnusedParameters()
Check for unused parameters
|
private void |
registerChild(java.lang.Object opt) |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasErrors, tryInstantiate
Parameterization inner
java.util.List<TrackedParameter> options
java.util.Map<java.lang.Object,java.lang.Object> parents
java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> children
java.lang.Object owner
public TrackParameters(Parameterization inner)
inner
- Inner parameterization to wrap.public TrackParameters(Parameterization inner, java.lang.Object owner)
inner
- Inner parameterization to wrap.owner
- Class/instance owning the parameterprivate TrackParameters(Parameterization inner, java.lang.Object owner, java.util.List<TrackedParameter> options, java.util.Map<java.lang.Object,java.lang.Object> parents, java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> children)
inner
- Inner parameterizationowner
- Object owning the current parametersoptions
- List of optionsparents
- Parent mapchildren
- Child mappublic java.util.Collection<ParameterException> getErrors()
Parameterization
Parameterization.grab(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter<?>)
getErrors
in interface Parameterization
public 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 boolean hasUnusedParameters()
Parameterization
hasUnusedParameters
in interface Parameterization
true
if at least one parameter was not consumedpublic void reportError(ParameterException e)
Parameterization
reportError
in interface Parameterization
e
- Destination to report errors topublic boolean setValueForOption(Parameter<?> opt) throws ParameterException
Parameterization
setValueForOption
in interface Parameterization
opt
- Parameter to setParameterException
- on assignment errors.public java.util.Collection<TrackedParameter> getAllParameters()
public Parameterization descend(java.lang.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.
Track parameters using a shared options list with parent tracker.descend
in interface Parameterization
option
- Option subtreeprivate void registerChild(java.lang.Object opt)
public java.lang.Object getParent(java.lang.Object pos)
pos
- Current objectCopyright © 2019 ELKI Development Team. License information.