Package com.hp.ucmdb.api.topology
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 anop()
. - Binary expression: This expression has both
left()
andright()
and an operator acting between them
ConditionExpressionVisitor
.- Since:
- UCMDB 9.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this is a leaf expression, false if this is a binary expression.leaf()
Returns the leaf if this is a leaf expression, or null if this is a binary expression.leaves()
Returns a collection of all the leaves under this condition expression.left()
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.right()
Returns the right (second) part of a binary expression, or null if this is a leaf expression.void
visit
(ConditionExpressionVisitor<T, O> visitor) Visits the expression using an (optionally client-based) visitor.
-
Method Details
-
left
ConditionExpression<T,O> 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
ConditionExpression<T,O> 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
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.
-