Class LessEqualConstraint
- java.lang.Object
-
- elki.utilities.optionhandling.constraints.AbstractNumberConstraint
-
- elki.utilities.optionhandling.constraints.LessEqualConstraint
-
- All Implemented Interfaces:
ParameterConstraint<java.lang.Number>
public class LessEqualConstraint extends AbstractNumberConstraint
Represents a Less-Equal-Than-Number parameter constraint. The value of the number parameter (NumberParameter
) tested has to be less equal than the specified constraint value.- Since:
- 0.1
- Author:
- Steffi Wanka
-
-
Field Summary
-
Fields inherited from class elki.utilities.optionhandling.constraints.AbstractNumberConstraint
constraintValue
-
-
Constructor Summary
Constructors Constructor Description LessEqualConstraint(double constraintValue)
Creates a Less-Equal-Than-Number parameter constraint.LessEqualConstraint(int constraintValue)
Creates a Less-Equal-Than-Number parameter constraint.LessEqualConstraint(java.lang.Number constraintValue)
Creates a Less-Equal-Than-Number parameter constraint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription(java.lang.String parameterName)
Returns a description of this constraint.void
test(java.lang.Number t)
Checks if the number value given by the number parameter is less equal than the constraint value.
-
-
-
Constructor Detail
-
LessEqualConstraint
public LessEqualConstraint(java.lang.Number constraintValue)
Creates a Less-Equal-Than-Number parameter constraint.That is, the value of the appropriate number parameter has to be less equal than the given constraint value.
- Parameters:
constraintValue
- the constraint value
-
LessEqualConstraint
public LessEqualConstraint(double constraintValue)
Creates a Less-Equal-Than-Number parameter constraint.That is, the value of the appropriate number parameter has to be less equal than the given constraint value.
- Parameters:
constraintValue
- the constraint value
-
LessEqualConstraint
public LessEqualConstraint(int constraintValue)
Creates a Less-Equal-Than-Number parameter constraint.That is, the value of the appropriate number parameter has to be less equal than the given constraint value.
- Parameters:
constraintValue
- the constraint value
-
-
Method Detail
-
test
public void test(java.lang.Number t) throws ParameterException
Checks if the number value given by the number parameter is less equal than the constraint value. 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
public java.lang.String getDescription(java.lang.String parameterName)
Description copied from interface:ParameterConstraint
Returns a description of this constraint.- Parameters:
parameterName
- the name of the parameter this constraint is used for- Returns:
- a description of this constraint
-
-