de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Class GlobalVectorListElementSizeConstraint
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.GlobalVectorListElementSizeConstraint
- All Implemented Interfaces:
- Loggable, GlobalParameterConstraint
public class GlobalVectorListElementSizeConstraint
- extends AbstractLoggable
- 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.
- Author:
- Steffi Wanka
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 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 |
vector
private VectorListParameter vector
- Vector list parameter.
size
private IntParameter size
- Integer parameter providing the size constraint.
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 parametersizeConstraint
- the integer parameter providing the size constraint
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.- 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()