de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Class DefaultValueGlobalConstraint<T extends Comparable<T>>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.DefaultValueGlobalConstraint<T>
- All Implemented Interfaces:
- Loggable, GlobalParameterConstraint
public class DefaultValueGlobalConstraint<T extends Comparable<T>>
- extends AbstractLoggable
- implements GlobalParameterConstraint
Global parameter constraint for specifying the default value of a parameter dependent on
the parameter value of another parameter.
- Author:
- Steffi Wanka
Method Summary |
String |
getDescription()
Returns a description of this global constraint. |
void |
test()
Checks if the parameter providing the default value is already set,
and if the two parameters have the same parameter type. |
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 |
needsValue
private Parameter<T extends Comparable<T>,?> needsValue
- Parameter to be set.
hasValue
private Parameter<T extends Comparable<T>,?> hasValue
- Parameter providing the value.
DefaultValueGlobalConstraint
public DefaultValueGlobalConstraint(Parameter<T,?> needsValue,
Parameter<T,?> hasValue)
- Creates a global parameter constraint for specifying the default value of a parameter
dependent on the value of an another paramter.
- Parameters:
needsValue
- the parameter whose default value is to be sethasValue
- the parameter providing the value
test
public void test()
throws ParameterException
- Checks if the parameter providing the default value is already set,
and if the two parameters have the same parameter type. If so, the
default value of one parameter is set as the default value of the other
parameter.
If not so, a parameter exception is thrown.
- Specified by:
test
in interface GlobalParameterConstraint
- Throws:
ParameterException
- if the parameters don't satisfy the parameter constraint.- See Also:
GlobalParameterConstraint.test()
getDescription
public String getDescription()
- Description copied from interface:
GlobalParameterConstraint
- Returns a description of this global constraint.
- Specified by:
getDescription
in interface GlobalParameterConstraint
- Returns:
- a description of this global constraint
- See Also:
GlobalParameterConstraint.getDescription()