Interface Evaluator

All Superinterfaces:
ValuesPredicate
All Known Subinterfaces:
LiteralEvaluator

public interface Evaluator extends ValuesPredicate
An internal representation of every condition in the rule engine.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The RELATION_EQUALS variable represents a constant value indicating equality relation.
    static final int
    The RELATION_INVERSE variable represents a constant value indicating inverse relationship.
    static final int
    Represents a constant value indicating no relation.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
     
    Describes fields and their ordering to be used during the evaluation
    default boolean
    Checks if the descriptor of this evaluator is the same as the descriptor of another evaluator.
    default Object[]
    A convenience method to convert evaluator's arguments to object array.

    Methods inherited from interface org.evrete.api.ValuesPredicate

    test
  • Field Details

    • RELATION_NONE

      static final int RELATION_NONE
      Represents a constant value indicating no relation.
      See Also:
    • RELATION_EQUALS

      static final int RELATION_EQUALS
      The RELATION_EQUALS variable represents a constant value indicating equality relation.
      See Also:
    • RELATION_INVERSE

      static final int RELATION_INVERSE
      The RELATION_INVERSE variable represents a constant value indicating inverse relationship.
      See Also:
  • Method Details

    • descriptor

      FieldReference[] descriptor()

      Describes fields and their ordering to be used during the evaluation

      Returns:
      fields in correct order
    • compare

      default int compare(Evaluator other)
      Parameters:
      other - predicate
      Returns:
      positive integer (>0) if predicates are logically the same, negative integer (<0) if predicates are logically inverted (like a == 2 and a != 2) zero (0) if there is no knowledge about the two or if they are independent
    • toArray

      default Object[] toArray(IntToValue values)

      A convenience method to convert evaluator's arguments to object array.

      Parameters:
      values - evaluator's arguments as a functional interface
      Returns:
      arguments as an array
    • sameDescriptor

      default boolean sameDescriptor(Evaluator other)
      Checks if the descriptor of this evaluator is the same as the descriptor of another evaluator.
      Parameters:
      other - the other evaluator to compare descriptors with
      Returns:
      true if the descriptors of the two evaluators are the same, false otherwise