Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

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

public class ParameterFlagGlobalConstraint<C,T extends C>
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.

Author:
Steffi Wanka

Field Summary
private  List<ParameterConstraint<C>> 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<T,C> param
          Parameter possibly to be checked.
 
Constructor Summary
ParameterFlagGlobalConstraint(Parameter<T,C> p, List<ParameterConstraint<C>> 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<T extends C,C> 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<C>> cons
List of parameter constraints.

Constructor Detail

ParameterFlagGlobalConstraint

public ParameterFlagGlobalConstraint(Parameter<T,C> p,
                                     List<ParameterConstraint<C>> 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.2 (2009-07-06_1820)