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

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

public class GlobalVectorListElementSizeConstraint
extends Object
implements GlobalParameterConstraint

Global parameter constraint for testing if the dimensions of each vector specified by a given vector list parameter (VectorListParameter) correspond to the value of a integer parameter (IntParameter) given.


Field Summary
private  IntParameter size
          Integer parameter providing the size constraint.
private  VectorListParameter vector
          Vector list parameter.
 
Constructor Summary
GlobalVectorListElementSizeConstraint(VectorListParameter vector, IntParameter sizeConstraint)
          Constructs a global vector size constraint.
 
Method Summary
 String getDescription()
          Returns a description of this global constraint.
 void test()
          Checks if the dimensions of each vector of the vector list parameter have the appropriate size provided by the integer parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vector

private VectorListParameter vector
Vector list parameter.


size

private IntParameter size
Integer parameter providing the size constraint.

Constructor Detail

GlobalVectorListElementSizeConstraint

public GlobalVectorListElementSizeConstraint(VectorListParameter vector,
                                             IntParameter sizeConstraint)
Constructs a global vector size constraint.

Each vector of the vector list parameter given is tested for being equal to the value of the integer parameter given.

Parameters:
vector - the vector list parameter
sizeConstraint - the integer parameter providing the size constraint
Method Detail

test

public void test()
          throws ParameterException
Checks if the dimensions of each vector of the vector list parameter have the appropriate size provided by the integer parameter. If not, a parameter exception will be 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)