de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Class ParameterFlagGlobalConstraint<S,C extends S>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.ParameterFlagGlobalConstraint<S,C>
Type Parameters:
C - Constraint type
S - Parameter type
All Implemented Interfaces:
GlobalParameterConstraint

public class ParameterFlagGlobalConstraint<S,C extends S>
extends Object
implements GlobalParameterConstraint

Global parameter constraint describing the dependency of a parameter ( Parameter) on a given flag (Flag). Depending on the status of the flag the parameter is tested for keeping its constraints or not.


Field Summary
private  List<ParameterConstraint<S>> cons
          List of parameter constraints.
private  Flag flag
          Flag the checking of the parameter constraints is dependent on.
private  boolean flagConstraint
          Indicates at which status of the flag the parameter is to be checked.
private  Parameter<S,C> param
          Parameter possibly to be checked.
 
Constructor Summary
ParameterFlagGlobalConstraint(Parameter<S,C> p, List<ParameterConstraint<S>> c, Flag f, boolean flagConstraint)
          Constructs a global parameter constraint specifying that the testing of the parameter given for keeping the parameter constraints given is dependent on the status of the flag given.
 
Method Summary
 String getDescription()
          Returns a description of this global constraint.
 void test()
          Checks the parameter for its parameter constraints dependent on the status of the given flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

param

private Parameter<S,C extends S> param
Parameter possibly to be checked.


flag

private Flag flag
Flag the checking of the parameter constraints is dependent on.


flagConstraint

private boolean flagConstraint
Indicates at which status of the flag the parameter is to be checked.


cons

private List<ParameterConstraint<S>> cons
List of parameter constraints.

Constructor Detail

ParameterFlagGlobalConstraint

public ParameterFlagGlobalConstraint(Parameter<S,C> p,
                                     List<ParameterConstraint<S>> c,
                                     Flag f,
                                     boolean flagConstraint)
Constructs a global parameter constraint specifying that the testing of the parameter given for keeping the parameter constraints given is dependent on the status of the flag given.

Parameters:
p - parameter possibly to be checked
c - a list of parameter constraints, if the value is null, the parameter is just tested if it is set.
f - flag controlling the checking of the parameter constraints
flagConstraint - indicates at which status of the flag the parameter is to be checked
Method Detail

test

public void test()
          throws ParameterException
Checks the parameter for its parameter constraints dependent on the status of the given flag. If a parameter constraint is breached 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)