Class ListEachNumberConstraint<T>
- java.lang.Object
-
- elki.utilities.optionhandling.constraints.ListEachNumberConstraint<T>
-
- All Implemented Interfaces:
ParameterConstraint<T>
public class ListEachNumberConstraint<T> extends java.lang.Object implements ParameterConstraint<T>
Applies numeric constraints to all elements of a list.- Since:
- 0.5.5
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AbstractNumberConstraint>
constraints
Constraints
-
Constructor Summary
Constructors Constructor Description ListEachNumberConstraint()
Constructor.ListEachNumberConstraint(AbstractNumberConstraint constraint)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraint(AbstractNumberConstraint constraint)
Add a constraint to this operator.java.lang.String
getDescription(java.lang.String parameterName)
Returns a description of this constraint.void
test(T t)
Checks if the valuet
of the parameter to be tested fulfills the parameter constraint.
-
-
-
Field Detail
-
constraints
private java.util.List<AbstractNumberConstraint> constraints
Constraints
-
-
Constructor Detail
-
ListEachNumberConstraint
public ListEachNumberConstraint()
Constructor.
-
ListEachNumberConstraint
public ListEachNumberConstraint(AbstractNumberConstraint constraint)
Constructor.- Parameters:
constraint
- Constraint to apply to all elements
-
-
Method Detail
-
addConstraint
public void addConstraint(AbstractNumberConstraint constraint)
Add a constraint to this operator.- Parameters:
constraint
- Constraint
-
test
public void test(T t) throws ParameterException
Description copied from interface:ParameterConstraint
Checks if the valuet
of the parameter to be tested fulfills the parameter constraint. If not, a parameter exception is thrown.- Specified by:
test
in interfaceParameterConstraint<T>
- 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.- Specified by:
getDescription
in interfaceParameterConstraint<T>
- Parameters:
parameterName
- the name of the parameter this constraint is used for- Returns:
- a description of this constraint
-
-