Interface ConditionExpression<T,O>

All Known Subinterfaces:
ConditionExpressionBuilder<T,O>

public interface ConditionExpression<T,O>
A root of an expression tree structure.

The following permutation are generally available, but specific constraints on the type of the expression may apply:

  • Leaf expression: This is the actual expression leaf. Only the leaf() method will not return null.
  • Bridge expression: This is a syntactic bridge. It bridges from the parent expression (if exists) to the left() expression with no operator.
  • Single element expression: This expression has a left() and an op().
  • Binary expression: This expression has both left() and right() and an operator acting between them
An expression may be explored using the getter methods, or by using the ConditionExpressionVisitor.
Since:
UCMDB 9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this is a leaf expression, false if this is a binary expression.
    Returns the leaf if this is a leaf expression, or null if this is a binary expression.
    Returns a collection of all the leaves under this condition expression.
    Returns the left (first) part of a binary expression, or null if this is a leaf expression.
    op()
    Returns the operand of the expression, or null if this is a leaf expression.
    Returns the right (second) part of a binary expression, or null if this is a leaf expression.
    void
    Visits the expression using an (optionally client-based) visitor.
  • Method Details

    • left

      Returns the left (first) part of a binary expression, or null if this is a leaf expression.

      Note: This is guaranteed not null even if the expression is a single-item expression.

    • right

      Returns the right (second) part of a binary expression, or null if this is a leaf expression.

      Note: Some operations may have single item expressions, in which case this method will return null as well.

    • op

      O op()
      Returns the operand of the expression, or null if this is a leaf expression.

      Note: Some expressions may have single-item operands.

    • isLeafExpression

      boolean isLeafExpression()
      Returns true if this is a leaf expression, false if this is a binary expression.
    • leaf

      T leaf()
      Returns the leaf if this is a leaf expression, or null if this is a binary expression.
    • leaves

      Collection<T> leaves()
      Returns a collection of all the leaves under this condition expression.
    • visit

      void visit(ConditionExpressionVisitor<T,O> visitor)
      Visits the expression using an (optionally client-based) visitor.

      This method CAN receive client implementations of ConditionExpressionVisitor

      Note: This method visits the current expression only. If traversing is needed, it is the client responsability to call the child expressions, if any are present, visit methods.

      Parameters:
      visitor - a client implementation of the ConditionExpressionVisitor interface.