de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Class GlobalListSizeConstraint

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.GlobalListSizeConstraint
All Implemented Interfaces:
GlobalParameterConstraint

public class GlobalListSizeConstraint
extends Object
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.


Field Summary
private  IntParameter length
          Integer parameter specifying the constraint list size.
private  ListParameter<?> list
          List parameter to be tested.
 
Constructor Summary
GlobalListSizeConstraint(ListParameter<?> v, IntParameter i)
          Creates a List-Size global parameter constraint.
 
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

private ListParameter<?> list
List parameter to be tested.


length

private IntParameter length
Integer parameter specifying the constraint list size.

Constructor Detail

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.
Method Detail

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.

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

Release 0.4.0 (2011-09-20_1324)