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

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

public class OnlyOneIsAllowedToBeSetGlobalConstraint
extends Object
implements GlobalParameterConstraint

Global parameter constraint specifying that only one parameter of a list of parameters (Parameter) is allowed to be set.


Field Summary
private  List<Parameter<?,?>> parameters
          List of parameters to be checked.
 
Constructor Summary
OnlyOneIsAllowedToBeSetGlobalConstraint(List<Parameter<?,?>> params)
          Constructs a global parameter constraint for testing if only one parameter of a list of parameters is set.
 
Method Summary
 String getDescription()
          Returns a description of this global constraint.
 void test()
          Checks if only one parameter of a list of parameters is set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameters

private List<Parameter<?,?>> parameters
List of parameters to be checked.

Constructor Detail

OnlyOneIsAllowedToBeSetGlobalConstraint

public OnlyOneIsAllowedToBeSetGlobalConstraint(List<Parameter<?,?>> params)
Constructs a global parameter constraint for testing if only one parameter of a list of parameters is set.

Parameters:
params - list of parameters to be checked
Method Detail

test

public void test()
          throws ParameterException
Checks if only one parameter of a list of parameters is set. 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)