|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
public abstract class AbstractParameterizable
Abstract superclass for classes parameterizable. Provides the option handler and the parameter array.
Field Summary | |
---|---|
private List<String> |
currentParameterArrayList
Holds the currently set parameter array. |
protected OptionHandler |
optionHandler
OptionHandler for handling options. |
private List<Pair<Parameterizable,List<OptionID>>> |
parameterizables
Hold parameterizables contained |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
AbstractParameterizable()
Creates a new AbstractParameterizable that provides the option handler and the parameter array. |
Method Summary | |
---|---|
protected void |
addOption(Option<?> option)
Adds the given Option to the set of Options known to this Parameterizable. |
protected void |
addParameterizable(Parameterizable p)
Add a new parameterizable to the list. |
protected void |
addParameterizable(Parameterizable p,
List<OptionID> override)
Add a new parameterizable to the list. |
void |
checkGlobalParameterConstraints()
Checks if all global parameter constraints are kept |
void |
collectOptions(List<Pair<Parameterizable,Option<?>>> collection)
Get all possible options. |
List<AttributeSettings> |
getAttributeSettings()
Returns the settings of all options assigned to the option handler. |
ArrayList<String> |
getParameters()
Returns the parameter array as given to the last call of setParameters(List)
but without unnecessary entries. |
protected void |
rememberParametersExcept(List<String> complete,
List<String> part)
Sets the difference of the first array minus the second array as the currently set parameter array. |
protected void |
removeOption(Option<?> option)
Deletes the given Option from the set of Options known to this Parameterizable. |
protected void |
removeParameterizable(Parameterizable p)
Remove a parameterizable from the list. |
List<String> |
setParameters(List<String> args)
Grabs all specified options from the option handler. |
String |
shortDescription()
Returns a short description of the class. |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected OptionHandler optionHandler
private List<String> currentParameterArrayList
private List<Pair<Parameterizable,List<OptionID>>> parameterizables
Constructor Detail |
---|
public AbstractParameterizable()
Method Detail |
---|
protected void addOption(Option<?> option)
option
- the Option to add to the set of known Options of this
Parameterizableprotected void removeOption(Option<?> option) throws UnusedParameterException
option
- the Option to remove from the set of Options known to this
Parameterizable
UnusedParameterException
- if the given Option is unknownprotected void addParameterizable(Parameterizable p)
p
- parameterizableprotected void addParameterizable(Parameterizable p, List<OptionID> override)
p
- parameterizableoverride
- overridden parametersprotected void removeParameterizable(Parameterizable p)
p
- parameterizable to removepublic List<String> setParameters(List<String> args) throws ParameterException
{ ListremainingParameters = super.setParameters(args); // set parameters for your class // for example like this: if(isSet(MY_PARAM_VALUE_PARAM)) { myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM); } . . . return remainingParameters; // or in case of attributes requesting parameters themselves // return parameterizableAttribbute.setParameters(remainingParameters); }
setParameters
in interface Parameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingprotected final void rememberParametersExcept(List<String> complete, List<String> part)
complete
- the complete arraypart
- an array that contains only elements of the first arraypublic final ArrayList<String> getParameters()
Parameterizable
setParameters(List)
but without unnecessary entries.
The provided array should be suitable to call
setParameters(List)
with it resulting in the identical parameterization.
getParameters
in interface Parameterizable
setParameters(List)
but without unnecessary entriespublic List<AttributeSettings> getAttributeSettings()
public String shortDescription()
shortDescription
in interface Parameterizable
public void checkGlobalParameterConstraints() throws ParameterException
Parameterizable
checkGlobalParameterConstraints
in interface Parameterizable
ParameterException
- if the parameters don't satisfy the parameter constraintsOptionHandler.checkGlobalParameterConstraints()
public void collectOptions(List<Pair<Parameterizable,Option<?>>> collection)
collectOptions
in interface Parameterizable
collection
- existing collection to add to.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |