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.utilities.optionhandling.constraints.DefaultValueGlobalConstraint<T>
Type Parameters:
T - Parameter type
All Implemented Interfaces:
GlobalParameterConstraint

public class DefaultValueGlobalConstraint<T extends Comparable<T>>
extends Object
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<? super T,T> hasValue
          Parameter providing the value.
private  Parameter<? super T,T> needsValue
          Parameter to be set.
 
Constructor Summary
DefaultValueGlobalConstraint(Parameter<? super T,T> needsValue, Parameter<? super T,T> hasValue)
          Creates a global parameter constraint for specifying the default value of a parameter dependent on the value of an another parameter.
 
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

needsValue

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


hasValue

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

Constructor Detail

DefaultValueGlobalConstraint

public DefaultValueGlobalConstraint(Parameter<? super T,T> needsValue,
                                    Parameter<? super T,T> hasValue)
Creates a global parameter constraint for specifying the default value of a parameter dependent on the value of an another parameter.

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.

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

Release 0.3 (2010-03-31_1612)