Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.sdo.helper.extension
Class OPStack

java.lang.Object
  extended by 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


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

state

private int state
Visibility reduced from [public] in 2.1.0. May 15 2007

stack

private java.util.Stack stack
Visibility reduced from [public] in 2.1.0. May 15 2007

tokens

private java.util.ArrayList tokens
Visibility reduced from [public] in 2.1.0. May 15 2007

out

private java.util.List out
Visibility reduced from [public] in 2.1.0. May 15 2007

Constructor Detail

OPStack

public OPStack()
The default constructor initializes the stack and Token list.

Method Detail

removeOCpair

private void removeOCpair()
Removes a '(' ')' pair from the stack.

pushSpew

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.
Parameters:
out -
t -

getNextToken

private Token getNextToken()
Returns the next Token in the list.
Returns:

parseExpression

private void parseExpression(java.lang.String exp)
Parse an XPath Expression into Token objects.
Parameters:
exp -

processExpression

public java.util.List processExpression(java.lang.String exp)
Process an XPath Expression into postfix notation.
Parameters:
exp -
Returns:

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.