Class RelationToConstant
- All Implemented Interfaces:
GenerateUniqueParameterization
Defines a constant threshold, and a relation to it.
This is useful to distinguish between different ways to threshold a range of numbers e.g.
>= 7
or < 5
.
The threshold
will always form the second-operand in the relation.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionRelationToConstant
(RelationBean relation, double threshold) Creates a newRelationToConstant
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The relation to the threshold, where the threshold forms the second operand.double
The constant threshold.int
hashCode()
relation()
The relation to the threshold.void
setRelation
(RelationBean relation) The relation to the threshold, where the threshold forms the second operand.void
setThreshold
(double threshold) The constant threshold.double
The threshold-value.toString()
By default, we useAnchorBean.describeBean()
as the string representation of the bean.A string describing this class and all its parameterization.Methods inherited from class org.anchoranalysis.bean.shared.relation.threshold.RelationToThreshold
asPredicateDouble, asPredicateInt
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
-
Constructor Details
-
RelationToConstant
public RelationToConstant()
-
-
Method Details
-
threshold
public double threshold()Description copied from class:RelationToThreshold
The threshold-value.- Specified by:
threshold
in classRelationToThreshold
- Returns:
- the value.
-
relation
Description copied from class:RelationToThreshold
The relation to the threshold.- Specified by:
relation
in classRelationToThreshold
- Returns:
- the predicate, where the threshold will form the second operand.
-
toString
Description copied from class:AnchorBean
By default, we useAnchorBean.describeBean()
as the string representation of the bean.- Overrides:
toString
in classAnchorBean<RelationToThreshold>
- Returns:
- the string representation
-
uniqueName
Description copied from interface:GenerateUniqueParameterization
A string describing this class and all its parameterization.It must be guaranteed to be unique for a given set of parameters.
- Returns:
- the unique name for the parameters.
-
equals
- Specified by:
equals
in interfaceGenerateUniqueParameterization
- Overrides:
equals
in classObject
-
canEqual
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceGenerateUniqueParameterization
- Overrides:
hashCode
in classObject
-
getRelation
The relation to the threshold, where the threshold forms the second operand. -
getThreshold
public double getThreshold()The constant threshold. -
setThreshold
public void setThreshold(double threshold) The constant threshold.
-