|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xpath.compiler.OpMap
public class OpMap
This class represents the data structure basics of the XPath object.
Field Summary | |
---|---|
(package private) static int |
BLOCKTOKENQUEUESIZE
|
protected java.lang.String |
m_currentPattern
The current pattern string, for diagnostics purposes |
(package private) OpMapVector |
m_opMap
An operations map is used instead of a proper parse tree. |
(package private) ObjectVector |
m_tokenQueue
TokenStack is the queue of used tokens. |
static int |
MAPINDEX_LENGTH
The length is always the opcode position + 1. |
(package private) static int |
MAXTOKENQUEUESIZE
The starting size of the token queue. |
Constructor Summary | |
---|---|
OpMap()
|
Method Summary | |
---|---|
void |
error(java.lang.String msg,
java.lang.Object[] args)
Tell the user of an error, and probably throw an exception. |
int |
getArgLength(int opPos)
Get the length of an operation. |
int |
getArgLengthOfStep(int opPos)
Given a location step, get the length of that step. |
static int |
getFirstChildPos(int opPos)
Go to the first child of a given operation. |
static int |
getFirstChildPosOfStep(int opPos)
Get the first child position of a given location step. |
int |
getFirstPredicateOpPos(int opPos)
Given an FROM_stepType position, return the position of the first predicate, if there is one, or else this will point to the end of the FROM_stepType. |
int |
getNextOpPos(int opPos)
Given an operation position, return the end position, i.e. |
static int |
getNextOpPos(int[] opMap,
int opPos)
Given an operation position, return the end position, i.e. |
int |
getNextStepPos(int opPos)
Given a location step position, return the end position, i.e. |
int |
getOp(int opPos)
Given an operation position, return the current op. |
OpMapVector |
getOpMap()
Get the opcode list that describes the XPath operations. |
java.lang.String |
getPatternString()
Return the expression as a string for diagnostics. |
java.lang.String |
getStepLocalName(int opPosOfStep)
Get the local name of the step. |
java.lang.String |
getStepNS(int opPosOfStep)
Get the namespace of the step. |
int |
getStepTestType(int opPosOfStep)
Get the test type of the step, i.e. |
java.lang.Object |
getToken(int pos)
Get the XPath as a list of tokens. |
ObjectVector |
getTokenQueue()
Get the XPath as a list of tokens. |
int |
getTokenQueueSize()
Get size of the token queue. |
void |
setOp(int opPos,
int value)
Set the op at index to the given int. |
(package private) void |
shrink()
Replace the large arrays with a small array. |
java.lang.String |
toString()
Return the expression as a string for diagnostics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String m_currentPattern
static final int MAXTOKENQUEUESIZE
static final int BLOCKTOKENQUEUESIZE
ObjectVector m_tokenQueue
OpMapVector m_opMap
public static final int MAPINDEX_LENGTH
Constructor Detail |
---|
public OpMap()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getPatternString()
public ObjectVector getTokenQueue()
public java.lang.Object getToken(int pos)
pos
- index into token queue.
public int getTokenQueueSize()
public OpMapVector getOpMap()
void shrink()
public int getOp(int opPos)
opPos
- index into op map.
public void setOp(int opPos, int value)
opPos
- index into op map.value
- Value to setpublic int getNextOpPos(int opPos)
opPos
- An op position of an operation for which there is a size
entry following.
public int getNextStepPos(int opPos)
opPos
- the position of a location step.
public static int getNextOpPos(int[] opMap, int opPos)
opMap
- The operations map.opPos
- index to operation, for which there is a size entry following.
public int getFirstPredicateOpPos(int opPos) throws javax.xml.transform.TransformerException
opPos
- position of FROM_stepType op.
javax.xml.transform.TransformerException
public void error(java.lang.String msg, java.lang.Object[] args) throws javax.xml.transform.TransformerException
msg
- An error msgkey that corresponds to one of the constants found
in XPATHErrorResources
, which is
a key for a format string.args
- An array of arguments represented in the format string, which
may be null.
TransformerException
- if the current ErrorListoner determines to
throw an exception.public static int getFirstChildPos(int opPos)
opPos
- position of operation.
public int getArgLength(int opPos)
opPos
- The position of the operation in the op map.
public int getArgLengthOfStep(int opPos)
opPos
- Position of location step in op map.
public static int getFirstChildPosOfStep(int opPos)
opPos
- Position of location step in the location map.
public int getStepTestType(int opPosOfStep)
opPosOfStep
- The position of the FROM_XXX step.
public java.lang.String getStepNS(int opPosOfStep)
opPosOfStep
- The position of the FROM_XXX step.
public java.lang.String getStepLocalName(int opPosOfStep)
opPosOfStep
- The position of the FROM_XXX step.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |