|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.sdo.helper.extension.OPStack
public class OPStack
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
Field Summary | |
---|---|
private java.util.List |
out Visibility reduced from [public] in 2.1.0. |
private java.util.Stack |
stack Visibility reduced from [public] in 2.1.0. |
private int |
state Visibility reduced from [public] in 2.1.0. |
private java.util.ArrayList |
tokens Visibility reduced from [public] in 2.1.0. |
Constructor Summary | |
---|---|
OPStack() The default constructor initializes the stack and Token list. |
Method Summary | |
---|---|
private Token |
getNextToken() Returns the next Token in the list. |
private void |
parseExpression(java.lang.String exp) Parse an XPath Expression into Token objects. |
java.util.List |
processExpression(java.lang.String exp) Process an XPath Expression into postfix notation. |
private void |
pushSpew(java.util.List outList, Token t) Removes lower priority tokens from the stack (adding them to the List that will be returned), then push the new token onto the stack. |
private void |
removeOCpair() Removes a '(' ')' pair from the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int state
private java.util.Stack stack
private java.util.ArrayList tokens
private java.util.List out
Constructor Detail |
---|
public OPStack()
Method Detail |
---|
private void removeOCpair()
private void pushSpew(java.util.List outList, Token t)
out
-t
-private Token getNextToken()
private void parseExpression(java.lang.String exp)
exp
-public java.util.List processExpression(java.lang.String exp)
exp
-
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |