org.eclipse.persistence.sdo.helper.extension
Class OPStack
java.lang.Object
org.eclipse.persistence.sdo.helper.extension.OPStack
public class OPStack
- extends java.lang.Object
Utility class used for processing an XPath Expression into postfix
notation. For example, consider the following expression:
quantity=5 and (specialOrder='false' or productName='Lawnmower')
The operations performed to create a postfix expression are:
1) add "quantity" to the list
2) push "=" onto the stack
3) add "5" to the list
4) pop "=" off the stack, and add to the list
5) push "and" onto the stack
6) push "(" onto the stack
7) add "specialOrder" to the list
8) push "=" onto the stack
9) add "'false'" to the list
10) pop "=" off the stack, and add to the list
11) push "or" onto the stack
12) add "productName" to the list
13) push "=" onto the stack
14) add "'Lawnmower'" to the list
15) pop "=" off the stack, and add to the list
16) pop "or" off the stack, and add to the list
17) push ")" onto the stack
18) pop "(" ")" pair off the stack
19) pop "and" off the stack, and add to the list
The resulting postfix expression is:
quantity 5 = specialOrder 'false' = productName 'Lawnmower' = or and
Constructor Summary |
OPStack()
The default constructor initializes the stack and
Token list. |
Method Summary |
java.util.List |
processExpression(java.lang.String exp)
Process an XPath Expression into postfix notation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OPStack
public OPStack()
- The default constructor initializes the stack and
Token list.
processExpression
public java.util.List processExpression(java.lang.String exp)
- Process an XPath Expression into postfix notation.
- Parameters:
exp
-
- Returns: