edu.cmu.aura.service.query
Class BoolNode

java.lang.Object
  |
  +--edu.cmu.aura.service.query.ExpressionNode
        |
        +--edu.cmu.aura.service.query.BoolNode

public class BoolNode
extends ExpressionNode

A boolean node in an expression tree applies a boolean operator to the results of its children.


Field Summary
static int MAX_OP_INDEX
           
static int OP_AND
           
static int OP_NOT
           
static int OP_OR
           
static java.lang.String[] opNames
           
 
Constructor Summary
BoolNode(int operator, ExpressionNode leftChild)
          Creates a BoolNode with a unary operator.
BoolNode(int operator, ExpressionNode leftChild, ExpressionNode rightChild)
          Creates a BoolNode with a binary operator.
 
Method Summary
static int getBoolOperator(java.lang.String boolOpName)
          Gets an operator given its name.
 ExpressionNode getLeftChild()
          Get the left child of this node.
 java.lang.String getOperatorName()
          Return the name of the operator at this BoolNode.
 ExpressionNode getRightChild()
          Get the right child of this node.
 boolean isUnary()
          Returns whether or not this BoolNode is unary.
 void setOperator(int operator)
          Set this node's operator
 
Methods inherited from class edu.cmu.aura.service.query.ExpressionNode
getOperator, isLeafNode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_AND

public static final int OP_AND
See Also:
Constant Field Values

OP_OR

public static final int OP_OR
See Also:
Constant Field Values

OP_NOT

public static final int OP_NOT
See Also:
Constant Field Values

MAX_OP_INDEX

public static final int MAX_OP_INDEX
See Also:
Constant Field Values

opNames

public static final java.lang.String[] opNames
Constructor Detail

BoolNode

public BoolNode(int operator,
                ExpressionNode leftChild,
                ExpressionNode rightChild)
Creates a BoolNode with a binary operator.

Parameters:
operator - the operator at this BoolNode
leftChild - the leftChild of this BoolNode
rightChild - the rightChild of this BoolNode

BoolNode

public BoolNode(int operator,
                ExpressionNode leftChild)
Creates a BoolNode with a unary operator.

Parameters:
operator - the operator at this BoolNode
leftChild - the leftChild of this BoolNode
Method Detail

getBoolOperator

public static int getBoolOperator(java.lang.String boolOpName)
Gets an operator given its name.

Parameters:
boolOpName - name of the operator to retrieve
Returns:
operator for the given boolOpName or -1 if the name is invalid

setOperator

public void setOperator(int operator)
Set this node's operator

Specified by:
setOperator in class ExpressionNode
Parameters:
operator - this node's operator

getOperatorName

public java.lang.String getOperatorName()
Return the name of the operator at this BoolNode.

Specified by:
getOperatorName in class ExpressionNode
Returns:
the name of this operator at this BoolNode

getLeftChild

public final ExpressionNode getLeftChild()
Get the left child of this node.

Returns:
the left child of this node

getRightChild

public final ExpressionNode getRightChild()
Get the right child of this node.

Returns:
the right child of this node

isUnary

public boolean isUnary()
Returns whether or not this BoolNode is unary.

Returns:
whether or not this BoolNode is unary