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:

An expression may be explored using the getter methods, or by using the ConditionExpressionVisitor.

Since:
UCMDB 9.0

Method Summary
 boolean isLeafExpression()
          Returns true if this is a leaf expression, false if this is a binary expression.
 T leaf()
          Returns the leaf if this is a leaf expression, or null if this is a binary expression.
 java.util.Collection<T> leaves()
          Returns a collection of all the leaves under this condition expression.
 ConditionExpression<T,O> left()
          Returns the left (first) part of a binary expression, or null if this is a leaf expression.
 O op()
          Returns the operand of the expression, or null if this is a leaf expression.
 ConditionExpression<T,O> 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 Detail

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

java.util.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.


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.