Interface IJavaPredicate

All Superinterfaces:
IJavaElement, IJavaExpression

@Ser public interface IJavaPredicate extends IJavaExpression
Java AST interface to represent a Java predicate. A predicate is a boolean expression that evaluates to true or false.

Note: Currently, logical expressions using non short-circuiting operators OR (|), AND (&), or XOR(^) are not allowed.

  • Method Details

    • getExpression

      IJavaExpression getExpression()
      Returns:
    • setExpression

      void setExpression(IJavaExpression expression)
      Parameters:
      expression -
    • isLitteralTrue

      boolean isLitteralTrue()
      Determine if the predicate represents the simple literal value 'true' ( null IDENT 'true').
      Returns:
      true if the predicate represents the literal true
    • isLitteralFalse

      boolean isLitteralFalse()
      Determine if the predicate represents the simple literal value 'false' ( null IDENT 'false').
      Returns:
      true if the predicate represents the literal false
    • reverse

      void reverse(IJavaOperatorFactory of)
      Reverse the predicate. Example: "x == 3" becomes "x != 3".
    • duplicateAndReverse

      IJavaPredicate duplicateAndReverse(IJavaOperatorFactory of)
      Parameters:
      of -
      Returns:
    • duplicate

      IJavaPredicate duplicate()
      Description copied from interface: IJavaElement
      Duplicate this element.
      Specified by:
      duplicate in interface IJavaElement
      Specified by:
      duplicate in interface IJavaExpression
      Returns:
      a (possibly) duplicated object of the same type