Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Interface ParameterConstraint<T>

Type Parameters:
T - the type of the constraint
All Known Implementing Classes:
AbstractNumberConstraint, DistanceFunctionPatternConstraint, EqualStringConstraint, GreaterConstraint, GreaterEqualConstraint, IntervalConstraint, LessConstraint, LessEqualConstraint, ListGreaterEqualConstraint, ListSizeConstraint

public interface ParameterConstraint<T>

Interface for specifying parameter constraints.

Each class specifying a constraint addressing only one parameter should implement this interface. The constraint value for testing the parameter should be defined as private attribute and should be initialized in the respective constructor of the class, i.e. it is a parameter of the constructor. The proper constraint test should be implemented in the method test(T).

Author:
Steffi Wanka

Method Summary
 String getDescription(String parameterName)
          Returns a description of this constraint.
 void test(T t)
          Checks if the value t of the parameter to be tested fulfills the parameter constraint.
 

Method Detail

test

void test(T t)
          throws ParameterException
Checks if the value t of the parameter to be tested fulfills the parameter constraint. If not, a parameter exception is thrown.

Parameters:
t - Value to be checked whether or not it fulfills the underlying parameter constraint.
Throws:
ParameterException - if the parameter to be tested does not fulfill the parameter constraint

getDescription

String getDescription(String parameterName)
Returns a description of this constraint.

Parameters:
parameterName - the name of the parameter this constraint is used for
Returns:
a description of this constraint

Release 0.2.1 (2009-07-13_1605)