Package ru.ewc.decita.conditions
Class BinaryCondition
java.lang.Object
ru.ewc.decita.conditions.BinaryCondition
- All Implemented Interfaces:
Condition
- Direct Known Subclasses:
EqualsCondition
,GreaterThanCondition
,LessThanCondition
I represent a simple
Condition
using two Coordinate
s and some comparison
operation. My main responsibility is to compute that comparison and check if it's true or not.- Since:
- 0.1
-
Constructor Summary
ModifierConstructorDescriptionprotected
BinaryCondition
(Coordinate left, Coordinate right) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.hamcrest.Matcher<Coordinate>
Creates aMatcher
that corresponds to the given operation andCoordinate
.final boolean
evaluate
(ComputationContext context) Evaluates all the parts of theCondition
and provides the result of that evaluation.final boolean
Checks if all the parts of the Condition are resolved and point to the constant values.final boolean
Checks if thisCondition
resolves totrue
.protected final Coordinate
Returns the right part of thisCondition
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ru.ewc.decita.conditions.Condition
isNotSatisfied
-
Constructor Details
-
BinaryCondition
Constructor.- Parameters:
left
- Left-sideCoordinate
.right
- Right-sideCoordinate
.
-
-
Method Details
-
evaluate
Description copied from interface:Condition
Evaluates all the parts of theCondition
and provides the result of that evaluation.- Specified by:
evaluate
in interfaceCondition
- Parameters:
context
- TheComputationContext
to evaluateCondition
in.- Returns:
- Whether the
Condition
stands true. - Throws:
DecitaException
- If the evaluation cannot be performed.
-
isEvaluated
public final boolean isEvaluated()Description copied from interface:Condition
Checks if all the parts of the Condition are resolved and point to the constant values.- Specified by:
isEvaluated
in interfaceCondition
- Returns:
- True, if both parts of the Condition are evaluated.
-
isSatisfied
public final boolean isSatisfied()Description copied from interface:Condition
Checks if thisCondition
resolves totrue
.- Specified by:
isSatisfied
in interfaceCondition
- Returns:
- True, if it does.
-
comparisonFor
Creates aMatcher
that corresponds to the given operation andCoordinate
.- Returns:
- The
Matcher
to use in thisCondition
.
-
rightPart
Returns the right part of thisCondition
.- Returns:
- The
Coordinate
that is its right part.
-