de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Class GlobalListSizeConstraint
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.GlobalListSizeConstraint
- All Implemented Interfaces:
- Loggable, GlobalParameterConstraint
public class GlobalListSizeConstraint
- extends AbstractLoggable
- implements GlobalParameterConstraint
Represents a global parameter constraint for testing if the size of
the list parameter (ListParameter
) given is equal to the constraint size
specified by the integer parameter (IntParameter
) given.
- Author:
- Steffi Wanka
Method Summary |
String |
getDescription()
Returns a description of this global constraint. |
void |
test()
Checks is the size of the list parameter is equal to the constraint list
size specified. |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
list
private ListParameter<?> list
- List parameter to be tested.
length
private IntParameter length
- Integer parameter specifying the constraint list size.
GlobalListSizeConstraint
public GlobalListSizeConstraint(ListParameter<?> v,
IntParameter i)
- Creates a List-Size global parameter constraint.
That is, the size of the given
list parameter hat to be equal to the constraint list size specified by the
integer parameter given.
- Parameters:
v
- the list parameter to be tested.i
- integer parameter specifying the constraint list size.
test
public void test()
throws ParameterException
- Checks is the size of the list parameter is equal to the constraint list
size specified. If not, a parameter exception is thrown.
- Specified by:
test
in interface GlobalParameterConstraint
- Throws:
ParameterException
- if the parameters don't satisfy the parameter constraint.- See Also:
GlobalParameterConstraint.test()
getDescription
public String getDescription()
- Description copied from interface:
GlobalParameterConstraint
- Returns a description of this global constraint.
- Specified by:
getDescription
in interface GlobalParameterConstraint
- Returns:
- a description of this global constraint
- See Also:
GlobalParameterConstraint.getDescription()