T
- the type of a possible value (i.e., the type of the option)public interface Parameter<T>
de.lmu.ifi.dbs.elki.utilities.optionhandling
package for
documentation!Modifier and Type | Method and Description |
---|---|
void |
addConstraint(ParameterConstraint<? super T> constraint)
Add an additional constraint.
|
T |
getDefaultValue()
Returns the default value of the parameter.
|
String |
getDefaultValueAsString()
Get the default value as string.
|
String |
getFullDescription()
Returns the extended description of the option which includes the option's
type, the short description and the default value (if specified).
|
Object |
getGivenValue()
Get the last given value.
|
String |
getName()
Returns the name of the option.
|
OptionID |
getOptionID()
Return the OptionID of this option.
|
String |
getShortDescription()
Returns the short description of the option.
|
String |
getSyntax()
Returns a string representation of the parameter's type (e.g. an
IntParameter
should return <int> ). |
T |
getValue()
Returns the value of the option.
|
String |
getValueAsString()
Get the value as string.
|
String |
getValuesDescription()
Return a string explaining valid values.
|
boolean |
hasDefaultValue()
Checks if this parameter has a default value.
|
boolean |
hasValuesDescription()
Whether this class has a list of default values.
|
boolean |
isDefined()
Returns true if the value of the option is defined, false otherwise.
|
boolean |
isOptional()
Checks if this parameter is an optional parameter.
|
boolean |
isValid(Object obj)
Checks if the given argument is valid for this option.
|
void |
setDefaultValue(T defaultValue)
Sets the default value of this parameter.
|
void |
setOptional(boolean opt)
Specifies if this parameter is an optional parameter.
|
void |
setShortDescription(String description)
Sets the short description of the option.
|
void |
setValue(Object obj)
Sets the value of the option.
|
boolean |
tookDefaultValue()
Checks if the default value of this parameter was taken as the actual
parameter value.
|
boolean |
tryDefaultValue()
Handle default values for a parameter.
|
void |
useDefaultValue()
Sets the default value of this parameter as the actual value of this
parameter.
|
void setDefaultValue(T defaultValue)
defaultValue
- default value of this parameterboolean hasDefaultValue()
void useDefaultValue()
boolean tryDefaultValue() throws UnspecifiedParameterException
true
if it has a default value, false
if it is optional without a default value. Exception if it is a
required parameter!UnspecifiedParameterException
- If the parameter requires a valuevoid setOptional(boolean opt)
opt
- true if this parameter is optional, false otherwiseboolean isOptional()
boolean tookDefaultValue()
boolean isDefined()
T getDefaultValue()
boolean hasValuesDescription()
String getValuesDescription()
String getFullDescription()
OptionID getOptionID()
String getName()
String getShortDescription()
void setShortDescription(String description)
description
- the short description to be setvoid setValue(Object obj) throws ParameterException
obj
- the option's value to be setParameterException
- if the given value is not a valid value for this
option.T getValue()
Parameterization.grab(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter<?>)
or isDefined()
to test if getValue() will return a well-defined
value.Object getGivenValue()
null
boolean isValid(Object obj) throws ParameterException
obj
- option value to be checkedParameterException
- if the given value is not a valid value for this
option.String getSyntax()
IntParameter
should return <int>
).String getValueAsString()
null
String getDefaultValueAsString()
void addConstraint(ParameterConstraint<? super T> constraint)
constraint
- Constraint to add.