de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints
Class GlobalDistanceFunctionPatternConstraint<D extends DistanceFunction<?,?>>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.GlobalDistanceFunctionPatternConstraint<D>
- All Implemented Interfaces:
- Loggable, GlobalParameterConstraint
public class GlobalDistanceFunctionPatternConstraint<D extends DistanceFunction<?,?>>
- extends AbstractLoggable
- implements GlobalParameterConstraint
Global parameter constraint for testing if a given pattern parameter (PatternParameter
) specifies a valid
pattern for a given class parameter (ClassParameter
) defining a specific distance function.
- Author:
- Steffi Wanka
Method Summary |
String |
getDescription()
Returns a description of this global constraint. |
void |
test()
Tests if the pattern is valid for the distance function defined by the class 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 |
restrictionClass
private ClassParameter<D extends DistanceFunction<?,?>> restrictionClass
- Class parameter whose restriction class is used to check the validity of the pattern parameter.
pattern
private PatternParameter pattern
- Pattern parameter to be checked for validity.
GlobalDistanceFunctionPatternConstraint
public GlobalDistanceFunctionPatternConstraint(PatternParameter pattern,
ClassParameter<D> restrClass)
- Constructs a global parameter constraint for testing if a given pattern parameter is a valid
argument for a given distance function of a class parameter.
- Parameters:
pattern
- the pattern parameterrestrClass
- the class parameter defining a distance function
test
public void test()
throws ParameterException
- Tests if the pattern is valid for the distance function defined by the class parameter. If not so, a parameter exception
is 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()