|
|
|||||||||||||||||||||
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 String[] |
currentParameterArray
Holds the currently set parameter array. |
protected OptionHandler |
optionHandler
OptionHandler for handling options. |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
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. |
|
void |
checkGlobalParameterConstraints()
Checks if all global parameter constraints are kept |
|
protected void |
deleteOption(Option<?> option)
Deletes the given Option from the set of Options known to this Parameterizable. |
|
String |
description()
Returns a description of the class and the required parameters. |
|
protected String |
description(String message)
Returns an usage-String by calling OptionHandler.usage(String) . |
|
protected String |
description(String message,
boolean standalone)
Returns an usage-String by calling OptionHandler.usage(String,boolean) . |
|
List<AttributeSettings> |
getAttributeSettings()
Returns the settings of all options assigned to the option handler. |
|
String[] |
getParameters()
Returns the parameter array as given to the last call of setParameters(String[])
but without unnecessary entries. |
|
protected
|
getParameterValue(Parameter<T,?> parameter)
Returns the value of the given parameter by calling Parameter.getValue() . |
|
Option<?>[] |
getPossibleOptions()
Returns an array containing all options of this parameterizable object |
|
String |
inlineDescription()
Returns a description of the class and the required parameters. |
|
protected boolean |
isSet(Option<?> option)
Returns true if the value of the given option is set, false otherwise. |
|
String[] |
setParameters(String[] args)
Sets the attributes of the class accordingly to the given parameters. |
|
protected void |
setParameters(String[] complete,
String[] part)
Sets the difference of the first array minus the second array as the currently set parameter array. |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, 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 String[] currentParameterArray
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 deleteOption(Option<?> option) throws UnusedParameterException
option
- the Option to remove from the set of Options known to this Parameterizable
UnusedParameterException
- if the given Option is unknownpublic String[] setParameters(String[] args) throws ParameterException
Parameterizable
setParameters
in interface Parameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingParameterizable.setParameters(String[])
protected final void setParameters(String[] complete, String[] part)
complete
- the complete arraypart
- an array that contains only elements of the first arraypublic final String[] getParameters()
Parameterizable
setParameters(String[])
but without unnecessary entries.
The provided array should be suitable to call
setParameters(String[])
with it resulting in the identical parameterization.
getParameters
in interface Parameterizable
setParameters(String[])
but without unnecessary entriesParameterizable.getParameters()
public List<AttributeSettings> getAttributeSettings()
getAttributeSettings
in interface Parameterizable
Parameterizable.getAttributeSettings()
public String description()
Parameterizable
description
in interface Parameterizable
Parameterizable.description()
public String inlineDescription()
Parameterizable
inlineDescription
in interface Parameterizable
Parameterizable.inlineDescription()
protected String description(String message)
OptionHandler.usage(String)
.
message
- some error-message, if needed (may be null or empty String)
protected String description(String message, boolean standalone)
OptionHandler.usage(String,boolean)
.
message
- some error-message, if needed (may be null or empty String)standalone
- whether the class using the OptionHandler provides a main
method
protected boolean isSet(Option<?> option)
option
- The option should be asked for without leading "-"
or closing ":".
OptionHandler.isSet(Option)
protected <T> T getParameterValue(Parameter<T,?> parameter) throws IllegalStateException
Parameter.getValue()
.
parameter
- the parameter to get the value of
IllegalStateException
- if this Parameterizable object has not been initialized
properly (e.g. the setParameters(String[]) method has been failed
to be called).Parameter.getValue()
public Option<?>[] getPossibleOptions()
Parameterizable
getPossibleOptions
in interface Parameterizable
Parameterizable.getPossibleOptions()
public void checkGlobalParameterConstraints() throws ParameterException
Parameterizable
checkGlobalParameterConstraints
in interface Parameterizable
ParameterException
Parameterizable.checkGlobalParameterConstraints()
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |