Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Class DefaultValueGlobalConstraint<T extends Comparable<T>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by 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

Field Summary
private  Parameter<T,?> hasValue
          Parameter providing the value.
private  Parameter<T,?> needsValue
          Parameter to be set.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
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.
 
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
 
Methods inherited from interface de.lmu.ifi.dbs.elki.logging.Loggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, verbose, verbose, warning
 

Field Detail

needsValue

private Parameter<T extends Comparable<T>,?> needsValue
Parameter to be set.


hasValue

private Parameter<T extends Comparable<T>,?> hasValue
Parameter providing the value.

Constructor Detail

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 set
hasValue - the parameter providing the value
Method Detail

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()

Release 0.1 (2008-07-10_1838)