Class BinaryCondition

java.lang.Object
ru.ewc.decita.conditions.BinaryCondition
All Implemented Interfaces:
Condition
Direct Known Subclasses:
EqualsCondition, GreaterThanCondition, LessThanCondition

public abstract class BinaryCondition extends Object implements Condition
I represent a simple Condition using two Coordinates and some comparison operation. My main responsibility is to compute that comparison and check if it's true or not.
Since:
0.1
  • Constructor Details

  • Method Details

    • evaluate

      public final boolean evaluate(ComputationContext context) throws DecitaException
      Description copied from interface: Condition
      Evaluates all the parts of the Condition and provides the result of that evaluation.
      Specified by:
      evaluate in interface Condition
      Parameters:
      context - The ComputationContext to evaluate Condition 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 interface Condition
      Returns:
      True, if both parts of the Condition are evaluated.
    • isSatisfied

      public final boolean isSatisfied()
      Description copied from interface: Condition
      Checks if this Condition resolves to true.
      Specified by:
      isSatisfied in interface Condition
      Returns:
      True, if it does.
    • comparisonFor

      protected abstract org.hamcrest.Matcher<Coordinate> comparisonFor()
      Creates a Matcher that corresponds to the given operation and Coordinate.
      Returns:
      The Matcher to use in this Condition.
    • rightPart

      protected final Coordinate rightPart()
      Returns the right part of this Condition.
      Returns:
      The Coordinate that is its right part.