de.fzi.XPath
Class NaryExpr
java.lang.Object
|
+--de.fzi.XPath.Expr
|
+--de.fzi.XPath.NaryExpr
- Direct Known Subclasses:
- AndExpr, OrderedExpr, OrExpr, UnionExpr
- public class NaryExpr
- extends Expr
NaryExpr
represents an expression which is a superexpression
over other expressions involving operators of sam precedence. Thus,
a * b div c mod d
requires only one superexpression which
would consist of four expressions associated from left to right. This
example equivalent to ((a * b) div c) mod d
but we will use
simplify the structure by not creating four superexpressions
Fields inherited from class de.fzi.XPath.Expr |
ADD_OP, AND_OP, DIV_OP, EQ_OP, GT_OP, GTE_OP, LT_OP, LTE_OP, MOD_OP, MUL_OP, NEQ_OP, NOP_OP, OR_OP, SUB_OP, U_OP |
Constructor Summary |
NaryExpr()
Constructor |
Method Summary |
Expr |
getExpr(int index)
Returns subexpression with given position. |
int |
getExprsCount()
Returns subexpression count. |
java.lang.String |
toString()
Returns string representation of n-ary expression. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NaryExpr
public NaryExpr()
- Constructor
getExpr
public Expr getExpr(int index)
- Returns subexpression with given position.
- Parameters:
index
- index of an expression in subexpression list.
- Returns:
- Returns subexpression with given position.
If there is no expression at given position, returns
null
.
getExprsCount
public int getExprsCount()
- Returns subexpression count.
- Returns:
- Returns subexpression count.
This number should be normally greater than 1: n-ary expressions have
at least two operands.
toString
public java.lang.String toString()
- Returns string representation of n-ary expression.
- Overrides:
toString
in class Expr
- Returns:
- Returns string representation of n-ary expression.
It is a list of subexpressions delimited by their operations.