edu.cmu.aura.service.query
Class LeafNode

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

public class LeafNode
extends ExpressionNode

A leaf node in an expression tree applies a comparison operator to an attribute and a literal value.


Field Summary
static java.lang.String[] alternateOpNames
           
static int MAX_OP_INDEX
           
static int OP_CUSTOM
           
static int OP_EQ
           
static int OP_GT
           
static int OP_GTEQ
           
static int OP_LT
           
static int OP_LTEQ
           
static int OP_NEQ
           
static int OP_UNKNOWN_OR_CUSTOM
           
static java.lang.String[] opNames
           
 
Constructor Summary
LeafNode(int operator, java.lang.String attribName, java.lang.Object literal)
          Creates a LeafNode
LeafNode(int operator, java.lang.String opName, java.lang.String attribName, java.lang.Object literal)
          Creates a LeafNode with a custom operator
 
Method Summary
 java.lang.String getAlternateOperatorName()
          Return the altername name of the operator at this LeafNode.
 java.lang.String getAttrib2Name()
           
 java.lang.String getAttribName()
          Return the name of the attribute at this LeafNode.
static int getLeafOperator(java.lang.String leafOpName)
          Gets an operator given its name.
 java.lang.Object getLiteral()
          Return the literal at this LeafNode.
 java.lang.String getOperatorName()
          Return the name of the operator at this LeafNode.
 void setAttrib2Name(java.lang.String attrib2Name)
           
 void setAttribName(java.lang.String attribName)
          Set the name of the attribute at this LeafNode.
 void setCustomOperator(java.lang.String opName)
          Set this node's operator
 void setLiteral(java.lang.Object literal)
          Set the literal at this LeafNode.
 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_EQ

public static final int OP_EQ
See Also:
Constant Field Values

OP_NEQ

public static final int OP_NEQ
See Also:
Constant Field Values

OP_GT

public static final int OP_GT
See Also:
Constant Field Values

OP_GTEQ

public static final int OP_GTEQ
See Also:
Constant Field Values

OP_LT

public static final int OP_LT
See Also:
Constant Field Values

OP_LTEQ

public static final int OP_LTEQ
See Also:
Constant Field Values

MAX_OP_INDEX

public static final int MAX_OP_INDEX
See Also:
Constant Field Values

OP_CUSTOM

public static final int OP_CUSTOM
See Also:
Constant Field Values

OP_UNKNOWN_OR_CUSTOM

public static final int OP_UNKNOWN_OR_CUSTOM
See Also:
Constant Field Values

opNames

public static final java.lang.String[] opNames

alternateOpNames

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

LeafNode

public LeafNode(int operator,
                java.lang.String attribName,
                java.lang.Object literal)
Creates a LeafNode

Parameters:
operator - the operator of this LeafNode.

LeafNode

public LeafNode(int operator,
                java.lang.String opName,
                java.lang.String attribName,
                java.lang.Object literal)
Creates a LeafNode with a custom operator

Parameters:
operator - the operator of this LeafNode.
Method Detail

getLeafOperator

public static int getLeafOperator(java.lang.String leafOpName)
Gets an operator given its name.

Parameters:
leafOpName - name of the operator to retrieve
Returns:
operator for the given leafOpName or OP_UNKNOWN_OR_CUSTOM if the not known (which could either be because it is an invalid operator name or because it is a custom operator).

getOperatorName

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

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

getAlternateOperatorName

public java.lang.String getAlternateOperatorName()
Return the altername name of the operator at this LeafNode.

Returns:
the altername name of this operator at this LeafNode

setOperator

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

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

setCustomOperator

public void setCustomOperator(java.lang.String opName)
Set this node's operator


getAttribName

public java.lang.String getAttribName()
Return the name of the attribute at this LeafNode.

Returns:
the name of this attribute at this LeafNode

setAttribName

public void setAttribName(java.lang.String attribName)
Set the name of the attribute at this LeafNode.

Parameters:
attribName - the name of the attribute at this LeafNode

getAttrib2Name

public java.lang.String getAttrib2Name()

setAttrib2Name

public void setAttrib2Name(java.lang.String attrib2Name)

getLiteral

public java.lang.Object getLiteral()
Return the literal at this LeafNode.

Returns:
the literal at this LeafNode.

setLiteral

public void setLiteral(java.lang.Object literal)
Set the literal at this LeafNode.

Parameters:
literal - the literal at this LeafNode