All Packages Class Hierarchy This Package Previous Next Index
Class Zql.ZExpression
java.lang.Object
|
+----Zql.ZExpression
- public class ZExpression
- extends Object
- implements ZExp
ZExpression: an SQL Expression
An SQL expression is an operator and one or more operands
Example: a AND b AND c -> operator = AND, operands = (a, b, c)
-
ZExpression(String)
- Create an SQL Expression given the operator
-
ZExpression(String, ZExp)
- Create an SQL Expression given the operator and 1st operand
-
ZExpression(String, ZExp, ZExp)
- Create an SQL Expression given the operator, 1st and 2nd operands
-
addOperand(ZExp)
- Add an operand to the current expression.
-
getOperand(int)
- Get an operand according to its index (position).
-
getOperands()
- Get this expression's operands.
-
getOperator()
- Get this expression's operator.
-
nbOperands()
- Get the number of operands
-
setOperands(Vector)
- Set the operands list
-
toReversePolish()
- String form of the current expression (reverse polish notation).
-
toString()
-
ZExpression
public ZExpression(String op)
- Create an SQL Expression given the operator
- Parameters:
- op - The operator
ZExpression
public ZExpression(String op,
ZExp o1)
- Create an SQL Expression given the operator and 1st operand
- Parameters:
- op - The operator
- o1 - The 1st operand
ZExpression
public ZExpression(String op,
ZExp o1,
ZExp o2)
- Create an SQL Expression given the operator, 1st and 2nd operands
- Parameters:
- op - The operator
- o1 - The 1st operand
- o2 - The 2nd operand
getOperator
public String getOperator()
- Get this expression's operator.
- Returns:
- the operator.
setOperands
public void setOperands(Vector v)
- Set the operands list
- Parameters:
- v - A vector that contains all operands (ZExp objects).
getOperands
public Vector getOperands()
- Get this expression's operands.
- Returns:
- the operands (as a Vector of ZExp objects).
addOperand
public void addOperand(ZExp o)
- Add an operand to the current expression.
- Parameters:
- o - The operand to add.
getOperand
public ZExp getOperand(int pos)
- Get an operand according to its index (position).
- Parameters:
- pos - The operand index, starting at 0.
- Returns:
- The operand at the specified index, null if out of bounds.
nbOperands
public int nbOperands()
- Get the number of operands
- Returns:
- The number of operands
toReversePolish
public String toReversePolish()
- String form of the current expression (reverse polish notation).
Example: a > 1 AND b = 2 -> (AND (> a 1) (= b 2))
- Returns:
- The current expression in reverse polish notation (a String)
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index