public class ListSizeConstraint extends Object implements ParameterConstraint<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 |
---|---|
String |
getDescription(String parameterName)
Returns a description of this constraint.
|
void |
test(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(Object t) throws ParameterException
test
in interface ParameterConstraint<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 String getDescription(String parameterName)
ParameterConstraint
getDescription
in interface ParameterConstraint<Object>
parameterName
- the name of the parameter this constraint is used forCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.