public class ListSizeConstraint extends java.lang.Object implements ParameterConstraint<java.lang.Object>
ListParameter
) to be tested has to be equal to the specified list
size constraint.
FIXME: Unfortunately, we cannot have good type safety anymore right now.
Modifier and Type | Field and Description |
---|---|
private int |
sizeConstraint
The list size constraint.
|
Constructor and Description |
---|
ListSizeConstraint(int size)
Constructs a list size constraint with the given constraint size.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription(java.lang.String parameterName)
Returns a description of this constraint.
|
void |
test(java.lang.Object t)
Checks if the list parameter fulfills the size constraint.
|
public ListSizeConstraint(int size)
size
- the size constraint for the list parameterpublic void test(java.lang.Object t) throws ParameterException
test
in interface ParameterConstraint<java.lang.Object>
t
- Value to be checked whether or not it fulfills the underlying
parameter constraint.ParameterException,
- if the size of the list parameter given is not
equal to the list size constraint specified.ParameterException
- if the parameter to be tested does not
fulfill the parameter constraintpublic java.lang.String getDescription(java.lang.String parameterName)
ParameterConstraint
getDescription
in interface ParameterConstraint<java.lang.Object>
parameterName
- the name of the parameter this constraint is used forCopyright © 2019 ELKI Development Team. License information.