|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ximpleware.VTDNav
public class VTDNav
The VTD Navigator allows one to navigate XML document represented in VTD records and Location caches. There is one and only one cursor that you can navigate to any part of the tree. If a method operating on a node doesn't accept the node as input, by default it refers to the cursor element. The hierarchy consists entirely of elements.
| Field Summary | |
|---|---|
protected boolean |
atTerminal
|
protected int[] |
context
|
protected ContextBuffer |
contextStack
|
protected ContextBuffer |
contextStack2
|
protected int |
count
|
protected BookMark |
currentNode
|
protected int |
docLen
|
protected int |
docOffset
|
protected int |
encoding
|
static int |
FC
|
protected FastIntBuffer |
fib
|
static int |
FIRST_CHILD
|
static int |
FORMAT_ASCII
|
static int |
FORMAT_ISO_8859_1
|
static int |
FORMAT_ISO_8859_10
|
static int |
FORMAT_ISO_8859_11
|
static int |
FORMAT_ISO_8859_12
|
static int |
FORMAT_ISO_8859_13
|
static int |
FORMAT_ISO_8859_14
|
static int |
FORMAT_ISO_8859_15
|
static int |
FORMAT_ISO_8859_16
|
static int |
FORMAT_ISO_8859_2
|
static int |
FORMAT_ISO_8859_3
|
static int |
FORMAT_ISO_8859_4
|
static int |
FORMAT_ISO_8859_5
|
static int |
FORMAT_ISO_8859_6
|
static int |
FORMAT_ISO_8859_7
|
static int |
FORMAT_ISO_8859_8
|
static int |
FORMAT_ISO_8859_9
|
static int |
FORMAT_UTF_16BE
|
static int |
FORMAT_UTF_16LE
|
static int |
FORMAT_UTF8
|
static int |
FORMAT_WIN_1250
|
static int |
FORMAT_WIN_1251
|
static int |
FORMAT_WIN_1252
|
static int |
FORMAT_WIN_1253
|
static int |
FORMAT_WIN_1254
|
static int |
FORMAT_WIN_1255
|
static int |
FORMAT_WIN_1256
|
static int |
FORMAT_WIN_1257
|
static int |
FORMAT_WIN_1258
|
protected FastLongBuffer |
l1Buffer
|
protected int |
l1index
|
protected FastLongBuffer |
l2Buffer
|
protected int |
l2index
|
protected int |
l2lower
|
protected int |
l2upper
|
protected FastIntBuffer |
l3Buffer
|
protected int |
l3index
|
protected int |
l3lower
|
protected int |
l3upper
|
static int |
LAST_CHILD
|
static int |
LC
|
protected int |
LN
|
protected String |
localName
|
protected int |
localNameIndex
|
protected static long |
MASK_TOKEN_DEPTH
|
protected static long |
MASK_TOKEN_FULL_LEN
|
protected static long |
MASK_TOKEN_NS_MARK
|
protected long |
MASK_TOKEN_OFFSET
|
protected static long |
MASK_TOKEN_PRE_LEN
|
protected static long |
MASK_TOKEN_QN_LEN
|
protected static long |
MASK_TOKEN_TYPE
|
protected short |
maxLCDepthPlusOne
|
protected String |
name
|
protected int |
nameIndex
|
protected int |
nestingLevel
|
static int |
NEXT_SIBLING
|
protected boolean |
ns
|
static int |
NS
|
static int |
P
|
static int |
PARENT
|
static int |
PREV_SIBLING
|
static int |
PS
|
static int |
R
|
static int |
ROOT
|
protected int |
rootIndex
|
protected boolean |
shallowDepth
|
protected int[] |
stackTemp
|
static int |
STRING_NORMALIZED
|
static int |
STRING_RAW
|
static int |
STRING_REGULAR
|
static int |
TOKEN_ATTR_NAME
|
static int |
TOKEN_ATTR_NS
|
static int |
TOKEN_ATTR_VAL
|
static int |
TOKEN_CDATA_VAL
|
static int |
TOKEN_CHARACTER_DATA
|
static int |
TOKEN_COMMENT
|
static int |
TOKEN_DEC_ATTR_NAME
|
static int |
TOKEN_DEC_ATTR_VAL
|
static int |
TOKEN_DOCUMENT
|
static int |
TOKEN_DTD_VAL
|
static int |
TOKEN_ENDING_TAG
|
static int |
TOKEN_PI_NAME
|
static int |
TOKEN_PI_VAL
|
static int |
TOKEN_STARTING_TAG
|
protected String |
URIName
|
protected FastLongBuffer |
vtdBuffer
|
protected int |
vtdSize
|
protected IByteBuffer |
XMLDoc
|
static short |
XPATH_STRING_MODE_LOWERCASE
|
static short |
XPATH_STRING_MODE_NORMAL
|
static short |
XPATH_STRING_MODE_UPPERCASE
|
| Constructor Summary | |
|---|---|
protected |
VTDNav()
|
protected |
VTDNav(int RootIndex,
int enc,
boolean NS,
int depth,
IByteBuffer x,
FastLongBuffer vtd,
FastLongBuffer l1,
FastLongBuffer l2,
FastIntBuffer l3,
int so,
int length)
Initialize the VTD navigation object. |
| Method Summary | |
|---|---|
protected void |
clearStack2()
clear the contextStack2 after XPath evaluation |
VTDNav |
cloneNav()
Clone the VTDNav instance to get with shared XML, VTD and LC buffers The node position is also copied from the original instance |
protected int |
compareNormalizedTokenString2(int offset,
int len,
String s)
|
protected int |
compareRawTokenString(int offset,
int len,
String s)
Lexicographically compare a string against a token with given offset and len, entities doesn't get resolved. |
int |
compareRawTokenString(int index,
String s)
New in 2.0 Compare the string against the token at the given index value. |
int |
compareTokens(int i1,
VTDNav vn2,
int i2)
New in 2.0 This method compares two VTD tokens of VTDNav objects The behavior of this method is like compare the strings corresponds to i1 and i2, meaning for text or attribute val, entities will be converted into the corresponding char, return 0 if two tokens are the identical when converted to Unicode String using toString() respectively |
protected int |
compareTokenString(int offset,
int len,
String s)
|
int |
compareTokenString(int index,
String s)
New in 2.0 Compare the string against the token at the given index value. |
boolean |
contains(int index,
String s)
Test whether a given token contains s. notie that this function directly operates on the byte content of the token to avoid string creation |
void |
dumpState()
|
void |
dumpXML(OutputStream os)
Dump the in memory XML text into output stream |
void |
dumpXML(String fileName)
Dump the in-memory copy of XML text into a file |
VTDNav |
duplicateNav()
Duplicate the VTDNav instance with shared XML, VTD and LC buffers This method may be useful for parallel XPath evaluation The node Position is at root element |
boolean |
endsWith(int index,
String s)
Test the end of token content at index i matches the content of s, notice that this is to save the string allocation cost of using String's built-in endsWidth |
void |
fillXPathString(FastIntBuffer indexBuffer,
FastIntBuffer countBuffer)
|
protected boolean |
getAtTerminal()
Get the value of atTerminal This function only gets called in XPath eval |
int |
getAttrCount()
Return the attribute count of the element at the cursor position. when ns is false, attr_ns tokens are considered attributes; otherwise, ns tokens are not considered attributes |
int |
getAttrVal(String an)
Get the token index of the attribute value given an attribute name. |
int |
getAttrValNS(String URL,
String ln)
Get the token index of the attribute value of given URL and local name. |
long |
getContentFragment()
Get content fragment returns a long encoding the offset and length of the byte segment of the content of current element, which is the byte segment between the starting tag and ending tag, -1 is returned if the current element is an empty element |
int |
getCurrentDepth()
Get the depth (>=0) of the current element. |
int |
getCurrentIndex()
Get the index value of the current element. |
protected int |
getCurrentIndex2()
|
long |
getElementFragment()
Get the starting offset and length of an element encoded in a long, upper 32 bits is length; lower 32 bits is offset Unit is in byte. |
ElementFragmentNs |
getElementFragmentNs()
getElementFragmentNS returns a ns aware version of the element fragment encapsulated in an ElementFragment object |
int |
getEncoding()
Get the encoding of the XML document. |
long |
getIndexsize()
Precompute the size of VTD+XML index |
int |
getNestingLevel()
Get the maximum nesting depth of the XML document (>0). max depth is nestingLevel -1 |
int |
getNormalizedStringLength(int index)
Get the string length of a token as if it is converted into a normalized UCS string |
long |
getOffsetAfterHead()
Return the charater (not byte) offset after head (the ending bracket of the starting tag, not including an empty element, in which case 0xffffffff 00000000 | len is returned) |
protected long |
getOffsetBeforeTail()
|
String |
getPrefixString(int i)
Return the prefix of a token as a string if the token is of the type of starting tag, attribute name, if the the prefix doesn't exist, a null string is returned; otherwise a null string is returned |
int |
getRawStringLength(int index)
Get the string length as if the token is converted into a UCS string (entity not resolved) |
int |
getRootIndex()
Get root index value , which is the index val of root element |
long |
getSiblingElementFragments(int i)
Return the byte offset and length of up to i sibling fragments. |
int |
getStringLength(int index)
getStringLength return the string length of a token as if the token is converted into a string (entity resolved for character data and attr val) |
int |
getText()
This method returns of the token index of the type character data or CDATA. |
int |
getTokenCount()
Get total number of VTD tokens for the current XML document. |
int |
getTokenDepth(int index)
Get the depth value of a token (>=0). |
int |
getTokenLength(int index)
Get the token length at the given index value please refer to VTD spec for more details Length is in terms of the UTF char unit For prefixed tokens, it is the qualified name length. |
protected int |
getTokenLength2(int index)
|
int |
getTokenOffset(int index)
Get the starting offset (unit in native char) of the token at the given index. |
int |
getTokenType(int index)
Get the token type of the token at the given index value. |
IByteBuffer |
getXML()
Get the XML document |
String |
getXPathStringVal()
|
String |
getXPathStringVal(short mode)
Return the String value of an Element Node |
protected String |
getXPathStringVal2(int j,
short mode)
|
boolean |
hasAttr(String an)
Test whether current element has an attribute with the matching name. "*" will match any attribute name, therefore is a test whether there is any attribute at all if namespace is disabled, this function will not distinguish between ns declaration and attribute otherwise, ns tokens are invisible Creation date: (11/16/03 5:50:26 PM) |
boolean |
hasAttrNS(String URL,
String ln)
Test whether the current element has an attribute with matching namespace URL and localname. |
protected boolean |
isElement(int index)
Test the token type, to see if it is a starting tag. |
protected boolean |
isElementOrDocument(int index)
Test the token type, to see if it is a starting tag or document token (introduced in 1.0). |
protected boolean |
iterate_following_node()
|
protected boolean |
iterate_following(String en,
boolean special)
This function is called by selectElement_F in autoPilot |
protected boolean |
iterate_followingNS(String URL,
String ln)
This function is called by selectElementNS_F in autoPilot |
protected boolean |
iterate_preceding_node(int[] a,
int endIndex)
|
protected boolean |
iterate_preceding(String en,
int[] a,
int endIndex)
This function is called by selectElement_P in autoPilot |
protected boolean |
iterate_precedingNS(String URL,
String ln,
int[] a,
int endIndex)
This function is called by selectElementNS_P in autoPilot |
protected boolean |
iterate(int dp,
String en,
boolean special)
This method is similar to getElementByName in DOM except it doesn't return the nodeset, instead it iterates over those nodes. |
protected boolean |
iterateNode(int dp)
|
protected boolean |
iterateNS(int dp,
String URL,
String ln)
This method is similar to getElementByName in DOM except it doesn't return the nodeset, instead it iterates over those nodes . |
protected void |
loadCurrentNode()
|
protected int |
lookupNS()
Test whether the URL is defined in the scope. |
protected int |
lookupNS(int offset,
int len)
This function returns the VTD record index of the namespace that matches the prefix of cursor element |
boolean |
matchElement(String en)
Test if the current element matches the given name. |
boolean |
matchElementNS(String URL,
String ln)
Test whether the current element matches the given namespace URL and localname. |
protected boolean |
matchNormalizedTokenString2(int index,
String s)
Match the string against the token at the given index value. |
boolean |
matchRawTokenString(int index,
String s)
Match the string against the token at the given index value. |
boolean |
matchTokens(int i1,
VTDNav vn2,
int i2)
This method matches two VTD tokens of VTDNav objects |
boolean |
matchTokenString(int index,
String s)
Match the string against the token at the given index value. |
protected boolean |
nodeToElement(int direction)
the corner case of element to node jump |
boolean |
overWrite(int index,
byte[] ba)
overWrite is introduced in version 2.0 that allows you to directly overwrite the XML content if the token is long enough If the operation is successful, the new content along with whitespaces will fill the available token space, and there will be no need to regenerate the VTD and LCs !!! |
boolean |
overWrite(int index,
byte[] ba,
int offset,
int len)
overWrite is introduced in version 2.0 that allows you to directly overwrite the XML content if the token is long enough If the operation is successful, white spaces will be used to fill the available token space, and there will be no need to regenerate the VTD and LCs The current version (2.0) only allows overwrites on attribute value, character data, and CDATA Consider the XML below: good After overwriting the token "good" with "bad," the new XML looks like: bad as you can see, "goo" is replaced with "bad", and the remaining "d" is replace with a white space |
double |
parseDouble(int index)
Convert a vtd token into a double. |
float |
parseFloat(int index)
Convert a vtd token into a float. we assume token type to be attr val or character data Creation date: (12/8/03 2:28:18 PM) |
int |
parseInt(int index)
Convert a vtd token into an int. |
protected int |
parseInt(int index,
int radix)
Convert a vtd token into an int, with the given radix. we assume token type to be attr val or character data the first char can be either '+' or '-' Creation date: (12/16/03 1:21:20 PM) |
long |
parseLong(int index)
Convert a vtd token into a long. we assume token type to be attr val or character data Creation date: (12/8/03 2:32:59 PM) |
protected long |
parseLong(int index,
int radix)
Convert a vtd token into a long, with the given radix. the first char can be either '+' or '-', leading and trailing will be stripped we assume token type to be attr val or character data Creation date: (12/17/03 1:51:06 PM) |
boolean |
pop()
Load the context info from ContextBuffer. |
protected boolean |
pop2()
Load the context info from contextStack2. |
void |
push()
Store the context info into the ContextBuffer. |
protected void |
push2()
Store the context info into the contextStack2. |
protected void |
recoverNode_l1(int index)
|
protected void |
recoverNode_l2(int index)
|
void |
recoverNode(int index)
This method takes a vtd index, and recover its correspondin node position, the index can only be of node type element, document, attribute name, attribute value or character data, or CDATA |
protected void |
resolveLC_l1()
Sync level 1 location cache |
protected void |
resolveLC_l2()
Sync Level 2 location cache |
protected void |
resolveLC_l3()
Sync L3 location Cache |
protected void |
resolveLC()
Sync up the current context with location cache. |
void |
sampleState(FastIntBuffer fib)
|
protected void |
setAtTerminal(boolean b)
Set the value of atTerminal This function only gets called in XPath eval when a step calls for @* or child::text() |
protected void |
setCurrentNode()
|
boolean |
startsWith(int index,
String s)
Test the start of token content at index i matches the content of s, notice that this is to save the string allocation cost of using String's built-in startsWidth |
protected void |
sync(int depth,
int index)
Used by following:: axis |
boolean |
toElement(int direction)
A generic navigation method. |
boolean |
toElement(int direction,
String en)
A generic navigation method. |
boolean |
toElementNS(int direction,
String URL,
String ln)
A generic navigation method with namespace support. |
protected boolean |
toNode_LastChild()
|
protected boolean |
toNode_PrevSibling()
|
protected boolean |
toNode(int dir)
|
String |
toNormalizedString(int index)
This method normalizes a token into a string value of character data and attr val in a way that resembles DOM. |
String |
toNormalizedString2(int index)
(New since version 2.9) Shallow Normalization follows the rules below to normalize a token into a string *#xD#xA gets converted to #xA *For a character reference, append the referenced character to the normalized value. |
String |
toNormalizedXPathString(int j)
|
String |
toRawString(int index)
Convert a token at the given index to a String, (entities and char references not expanded). |
String |
toRawString(int os,
int len)
Convert a segment of XML bytes a into string, without entity resolution |
protected void |
toRawString(int os,
int len,
StringBuffer sb)
|
protected void |
toRawString(int os,
int len,
StringBuilder sb)
|
protected void |
toRawString(StringBuilder sb,
int index)
|
String |
toRawStringLowerCase(int index)
Convert a token at the given index to a String, upper case chars get converted into lower case (entities and char references not expanded). |
protected String |
toRawStringLowerCase(int os,
int len)
|
protected void |
toRawStringLowerCase(int os,
int len,
StringBuilder sb)
|
String |
toRawStringUpperCase(int index)
Convert a token at the given index to a String, lower case chars get converted into upper case (entities and char references not expanded). |
protected String |
toRawStringUpperCase(int os,
int len)
|
protected void |
toRawStringUpperCase(int os,
int len,
StringBuilder sb)
|
String |
toString(int index)
Convert a token at the given index to a String, (entities and char references resolved character data and attr val). |
String |
toString(int os,
int len)
Convert the byte content segment (in terms of offset and length) to String (entities are resolved) |
protected void |
toString(int os,
int len,
StringBuilder sb)
|
protected void |
toString(StringBuilder sb,
int index)
|
String |
toStringLowerCase(int index)
Convert a token at the given index to a String and any upper case character will be converted to lower case, (entities and char references resolved for character data and attr val). |
protected String |
toStringLowerCase(int os,
int len)
Convert the byte content segment (in terms of offset and length) to String, upper case characters are converted to lower case |
protected void |
toStringLowerCase(int os,
int len,
StringBuilder sb)
|
protected void |
toStringLowerCase(StringBuilder sb,
int index)
|
String |
toStringUpperCase(int index)
Convert a token at the given index to a String and any lower case character will be converted to upper case, (entities and char references resolved character data and attr val). |
protected String |
toStringUpperCase(int os,
int len)
Convert the byte content segment (in terms of offset and length) to String, lower case characters are converted to upper case |
protected void |
toStringUpperCase(int os,
int len,
StringBuilder sb)
|
protected void |
toStringUpperCase(StringBuilder sb,
int index)
|
boolean |
verifyNodeCorrectness()
This is for debugging purpose |
void |
writeIndex(OutputStream os)
Write VTDNav's internal structure into an OutputStream |
void |
writeIndex(String fileName)
Write VTDNav's internal structure into a VTD+XML file |
void |
writeSeparateIndex(OutputStream os)
Write VTDNav's VTD and LCs into an OutputStream (XML not written out) |
void |
writeSeparateIndex(String fileName)
Write VTDNav's internal structure (VTD and LCs, but not XML) into a file |
boolean |
XPathStringVal_Contains(int j,
String s)
|
boolean |
XPathStringVal_EndsWith(int j,
String s)
|
boolean |
XPathStringVal_StartsWith(int j,
String s)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ROOT
public static final int PARENT
public static final int FIRST_CHILD
public static final int LAST_CHILD
public static final int NEXT_SIBLING
public static final int PREV_SIBLING
public static final int R
public static final int P
public static final int FC
public static final int LC
public static final int NS
public static final int PS
public static final int TOKEN_STARTING_TAG
public static final int TOKEN_ENDING_TAG
public static final int TOKEN_ATTR_NAME
public static final int TOKEN_ATTR_NS
public static final int TOKEN_ATTR_VAL
public static final int TOKEN_CHARACTER_DATA
public static final int TOKEN_COMMENT
public static final int TOKEN_PI_NAME
public static final int TOKEN_PI_VAL
public static final int TOKEN_DEC_ATTR_NAME
public static final int TOKEN_DEC_ATTR_VAL
public static final int TOKEN_CDATA_VAL
public static final int TOKEN_DTD_VAL
public static final int TOKEN_DOCUMENT
public static final int FORMAT_UTF8
public static final int FORMAT_ASCII
public static final int FORMAT_ISO_8859_1
public static final int FORMAT_ISO_8859_2
public static final int FORMAT_ISO_8859_3
public static final int FORMAT_ISO_8859_4
public static final int FORMAT_ISO_8859_5
public static final int FORMAT_ISO_8859_6
public static final int FORMAT_ISO_8859_7
public static final int FORMAT_ISO_8859_8
public static final int FORMAT_ISO_8859_9
public static final int FORMAT_ISO_8859_10
public static final int FORMAT_ISO_8859_11
public static final int FORMAT_ISO_8859_12
public static final int FORMAT_ISO_8859_13
public static final int FORMAT_ISO_8859_14
public static final int FORMAT_ISO_8859_15
public static final int FORMAT_ISO_8859_16
public static final int FORMAT_WIN_1250
public static final int FORMAT_WIN_1251
public static final int FORMAT_WIN_1252
public static final int FORMAT_WIN_1253
public static final int FORMAT_WIN_1254
public static final int FORMAT_WIN_1255
public static final int FORMAT_WIN_1256
public static final int FORMAT_WIN_1257
public static final int FORMAT_WIN_1258
public static final int FORMAT_UTF_16LE
public static final int FORMAT_UTF_16BE
public static final int STRING_RAW
public static final int STRING_REGULAR
public static final int STRING_NORMALIZED
protected static final long MASK_TOKEN_FULL_LEN
protected static final long MASK_TOKEN_PRE_LEN
protected static final long MASK_TOKEN_QN_LEN
protected long MASK_TOKEN_OFFSET
protected static final long MASK_TOKEN_TYPE
protected static final long MASK_TOKEN_DEPTH
protected static final long MASK_TOKEN_NS_MARK
protected short maxLCDepthPlusOne
protected int rootIndex
protected int nestingLevel
protected int[] context
protected boolean atTerminal
protected int l2upper
protected int l2lower
protected int l3upper
protected int l3lower
protected int l2index
protected int l3index
protected int l1index
protected FastLongBuffer vtdBuffer
protected FastLongBuffer l1Buffer
protected FastLongBuffer l2Buffer
protected FastIntBuffer l3Buffer
protected IByteBuffer XMLDoc
protected ContextBuffer contextStack
protected ContextBuffer contextStack2
protected int LN
protected int encoding
protected boolean ns
protected int[] stackTemp
protected int docOffset
protected int docLen
protected int vtdSize
protected String name
protected int nameIndex
protected String localName
protected int localNameIndex
protected FastIntBuffer fib
protected boolean shallowDepth
protected BookMark currentNode
protected String URIName
protected int count
public static final short XPATH_STRING_MODE_NORMAL
public static final short XPATH_STRING_MODE_UPPERCASE
public static final short XPATH_STRING_MODE_LOWERCASE
| Constructor Detail |
|---|
protected VTDNav()
protected VTDNav(int RootIndex,
int enc,
boolean NS,
int depth,
IByteBuffer x,
FastLongBuffer vtd,
FastLongBuffer l1,
FastLongBuffer l2,
FastIntBuffer l3,
int so,
int length)
RootIndex - intmaxDepth - intencoding - intNS - booleanx - byte[]vtd - com.ximpleware.ILongBufferl1 - com.ximpleware.ILongBufferl2 - com.ximpleware.ILongBufferl3 - com.ximpleware.IIntBufferso - int starting offset of the document(in byte)length - int length of the document (in byte)| Method Detail |
|---|
public int getAttrCount()
public int getAttrVal(String an)
throws NavException
an - java.lang.String
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD etc can be generated
by another machine from a load-balancer.
IllegalArguementException - if an is null
public int getAttrValNS(String URL,
String ln)
throws NavException
URL - java.lang.String (Name space URL)ln - java.lang.String (local name)
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD etc can be generated
by another machine from a load-balancer.
IllegalArguementException - if s is null
public void dumpXML(OutputStream os)
throws IOException
os -
IOException
public void dumpXML(String fileName)
throws IOException
fileName -
IOExceptionpublic final int getCurrentDepth()
public final int getCurrentIndex()
protected final int getCurrentIndex2()
public ElementFragmentNs getElementFragmentNs()
throws NavException
NavException
public long getSiblingElementFragments(int i)
throws NavException
i - number of silbing elements including the cursor element
NavException
public long getElementFragment()
throws NavException
NavExceptionpublic final int getEncoding()
public final int getNestingLevel()
public final long getOffsetAfterHead()
protected final long getOffsetBeforeTail()
throws NavException
NavExceptionpublic final int getRootIndex()
public int getText()
public final int getTokenCount()
public final int getTokenDepth(int index)
index - int
protected final int getTokenLength2(int index)
public int getTokenLength(int index)
index - int
public final int getTokenOffset(int index)
index - int
public final IByteBuffer getXML()
public final int getTokenType(int index)
index - int
public final boolean hasAttr(String an)
throws NavException
an - java.lang.String
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD etc can be generated
by another machine from a load-balancer.
IllegalArguementException - if an is null
public final boolean hasAttrNS(String URL,
String ln)
throws NavException
URL - java.lang.String (namespace URL)ln - java.lang.String (localname )
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.
IllegalArguementException - if ln is nullprotected final boolean isElement(int index)
index - int
protected final boolean isElementOrDocument(int index)
index - int
protected boolean iterate_preceding(String en,
int[] a,
int endIndex)
throws NavException
en - element Namea - context of current positionspecial - whether the test type is node()
NavException
protected boolean iterate_precedingNS(String URL,
String ln,
int[] a,
int endIndex)
throws NavException
URL - ln -
NavException
protected boolean iterate_following(String en,
boolean special)
throws NavException
en - ElementNamespecial - whether it is a node()
NavException
protected boolean iterate_followingNS(String URL,
String ln)
throws NavException
URL - ln -
NavException
protected boolean iterate(int dp,
String en,
boolean special)
throws NavException
dp - int (The depth of the starting position before iterating)en - java.lang.String
NavException - The exception is signaled if the underlying byte content
contains various errors. Notice that we are being
conservative in making little assumption on the
correctness of underlying byte content. This is because
VTD records can be generated by another machine from a
load-balancer. null element name allowed represent
node()in XPath;
protected boolean iterate_preceding_node(int[] a,
int endIndex)
throws NavException
NavException
protected boolean iterate_following_node()
throws NavException
NavException
protected boolean iterateNode(int dp)
throws NavException
NavException
protected boolean iterateNS(int dp,
String URL,
String ln)
throws NavException
dp - int (The depth of the starting position before iterating)URL - java.lang.Stringln - java.lang.String
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because VTD records can be generated
by another machine from a load-balancer..
IllegalArguementException - if ln is null example
int depth = nv.getCurrentDepth() while(iterateNS(depth,
"www.url.com","node_name")){ push(); // store the current position //move
position safely pop(); // load the position }
public final boolean matchElement(String en)
throws NavException
en - java.lang.String
NavException - If the underlying raw char representation has errors.
public final boolean matchElementNS(String URL,
String ln)
throws NavException
URL - java.lang.Stringln - java.lang.String
NavException - When there is any encoding conversion error or unknown
entity.
protected final int compareTokenString(int offset,
int len,
String s)
throws NavException
NavException
public final int compareTokens(int i1,
VTDNav vn2,
int i2)
throws NavException
i1 - vn2 - i2 -
NavException
protected final int compareRawTokenString(int offset,
int len,
String s)
throws NavException
offset - intlen - ints - java.lang.String
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.
public final int compareRawTokenString(int index,
String s)
throws NavException
index - s -
NavException
public final boolean matchRawTokenString(int index,
String s)
throws NavException
index - int (index into the VTD token buffer)s - java.lang.String
NavException - When if the underlying byte content contains various
errors. Notice that we are being conservative in making
little assumption on the correctness of underlying byte
content. This is because the VTD can be generated by
another machine such as a load-balancer.
public final int compareTokenString(int index,
String s)
throws NavException
index - s -
NavException
public final boolean matchTokenString(int index,
String s)
throws NavException
index - ints - java.lang.String
NavException - When if the underlying byte content contains various
errors. Notice that we are being conservative in making
little assumption on the correctness of underlying byte
content. This is because the VTD can be generated by
another machine such as a load-balancer.
protected final boolean matchNormalizedTokenString2(int index,
String s)
throws NavException
index - s -
NavException
protected final int compareNormalizedTokenString2(int offset,
int len,
String s)
throws NavException
NavException
public final boolean overWrite(int index,
byte[] ba)
index - ba - the byte array contains the new content to be overwritten
public boolean overWrite(int index,
byte[] ba,
int offset,
int len)
index - the VTD record to which the change will be appliedba - the byte array contains the new content to be overwrittenoffset - len -
public double parseDouble(int index)
throws NavException
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.
public float parseFloat(int index)
throws NavException
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.
public int parseInt(int index)
throws NavException
index - int
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.
protected int parseInt(int index,
int radix)
throws NavException
index - intradix - int
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.
public long parseLong(int index)
throws NavException
index - int
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.
protected long parseLong(int index,
int radix)
throws NavException
index - intradix - int
NavException - The exception if the underlying byte content contains
various errors. Notice that we are being conservative in
making little assumption on the correctness of underlying
byte content. This is because the VTD can be generated by
another machine such as a load-balancer.public boolean pop()
protected boolean pop2()
public void push()
protected void push2()
protected final void clearStack2()
protected void sync(int depth,
int index)
depth - index - protected void resolveLC()
protected void resolveLC_l1()
protected void resolveLC_l2()
protected void resolveLC_l3()
protected final int lookupNS()
throws NavException
URL - java.lang.String
NavException - When there is any encoding conversion error or unknown
entity.
protected int lookupNS(int offset,
int len)
URL -
public boolean toElement(int direction)
throws NavException
ROOT 0
PARENT 1
FIRST_CHILD 2
LAST_CHILD 3
NEXT_SIBLING 4
PREV_SIBLING 5
direction - int
NavException - When direction value is illegal.protected boolean nodeToElement(int direction)
direction -
public boolean toElement(int direction,
String en)
throws NavException
ROOT 0
PARENT 1
FIRST_CHILD 2
LAST_CHILD 3
NEXT_SIBLING 4
PREV_SIBLING 5
direction - inten - String
NavException - When direction value is illegal. Or there are errors in
underlying byte representation of the document
IllegalArguementException - if en is null
public boolean toElementNS(int direction,
String URL,
String ln)
throws NavException
ROOT 0
PARENT 1
FIRST_CHILD 2
LAST_CHILD 3
NEXT_SIBLING 4
PREV_SIBLING 5
direction - intURL - Stringln - String
NavException - When direction value is illegal. Or there are errors in
underlying byte representation of the document
public String toNormalizedString2(int index)
throws NavException
index -
NavException
public String toNormalizedString(int index)
throws NavException
index - int
NavException - When the encoding has errors
public final int getNormalizedStringLength(int index)
throws NavException
index -
NavException
public final String toRawString(int index)
throws NavException
index - int
NavException - When the encoding has errors
protected final void toRawString(StringBuilder sb,
int index)
throws NavException
NavException
public final String toRawStringLowerCase(int index)
throws NavException
index -
NavException
public final String toRawStringUpperCase(int index)
throws NavException
index -
NavException
public final String toRawString(int os,
int len)
throws NavException
os - (in terms of chars not bytes)len - (in terms of chars not bytes)
NavException
protected final void toRawString(int os,
int len,
StringBuffer sb)
throws NavException
NavException
protected final void toRawString(int os,
int len,
StringBuilder sb)
throws NavException
NavException
protected final void toString(int os,
int len,
StringBuilder sb)
throws NavException
NavException
protected final void toStringUpperCase(int os,
int len,
StringBuilder sb)
throws NavException
NavException
protected final void toStringLowerCase(int os,
int len,
StringBuilder sb)
throws NavException
NavException
public final int getStringLength(int index)
throws NavException
index -
NavException
public final int getRawStringLength(int index)
throws NavException
index -
NavException
public String toString(int index)
throws NavException
index -
NavException
public String toStringUpperCase(int index)
throws NavException
index -
NavException
public String toStringLowerCase(int index)
throws NavException
index -
NavException
public final String toString(int os,
int len)
throws NavException
os - the char offset of the segment (not byte)len - the length of the segment in char (not byte)
NavException
protected final void toString(StringBuilder sb,
int index)
throws NavException
NavException
protected final void toStringUpperCase(StringBuilder sb,
int index)
throws NavException
NavException
protected final void toStringLowerCase(StringBuilder sb,
int index)
throws NavException
NavException
protected final String toStringUpperCase(int os,
int len)
throws NavException
os - the offset of the segmentlen - the length of the segment
NavException
protected final String toStringLowerCase(int os,
int len)
throws NavException
os - the offset of the segmentlen - the length of the segment
NavException
protected final String toRawStringLowerCase(int os,
int len)
throws NavException
NavException
protected final void toRawStringLowerCase(int os,
int len,
StringBuilder sb)
throws NavException
NavException
protected final String toRawStringUpperCase(int os,
int len)
throws NavException
NavException
protected final void toRawStringUpperCase(int os,
int len,
StringBuilder sb)
throws NavException
NavException
public final boolean matchTokens(int i1,
VTDNav vn2,
int i2)
throws NavException
i1 - index of the first tokenvn2 - the second VTDNav instancei2 - index of the second token
NavExceptionprotected final void setAtTerminal(boolean b)
b -
public final boolean startsWith(int index,
String s)
throws NavException
i - s -
NavException
public final boolean endsWith(int index,
String s)
throws NavException
i -
NavException
public final boolean contains(int index,
String s)
throws NavException
index - s -
NavExceptionprotected final boolean getAtTerminal()
public boolean verifyNodeCorrectness()
fib - public void sampleState(FastIntBuffer fib)
public void dumpState()
public void writeIndex(OutputStream os)
throws IndexWriteException,
IOException
os -
IndexWriteException
IOException
public void writeSeparateIndex(OutputStream os)
throws IndexWriteException,
IOException
os -
IndexWriteException
IOException
public void writeIndex(String fileName)
throws IOException,
IndexWriteException
fileName -
IOException
IndexWriteException
public void writeSeparateIndex(String fileName)
throws IOException,
IndexWriteException
fileName -
IOException
IndexWriteExceptionpublic long getIndexsize()
public VTDNav duplicateNav()
public VTDNav cloneNav()
public final void fillXPathString(FastIntBuffer indexBuffer,
FastIntBuffer countBuffer)
throws NavException
NavException
public final String getXPathStringVal()
throws NavException
NavException
public final String getXPathStringVal(short mode)
throws NavException
mode -
NavException
protected final String getXPathStringVal2(int j,
short mode)
throws NavException
NavException
public final boolean XPathStringVal_Contains(int j,
String s)
throws NavException
NavException
public final boolean XPathStringVal_StartsWith(int j,
String s)
throws NavException
NavException
public final boolean XPathStringVal_EndsWith(int j,
String s)
throws NavException
NavException
public long getContentFragment()
throws NavException
NavException
public void recoverNode(int index)
throws NavException
index -
NavExceptionprotected final void recoverNode_l1(int index)
protected final void recoverNode_l2(int index)
public String getPrefixString(int i)
throws NavException
i - VTD index of a token
NavExceptionprotected void setCurrentNode()
protected void loadCurrentNode()
protected boolean toNode(int dir)
throws NavException
NavExceptionprotected boolean toNode_PrevSibling()
protected boolean toNode_LastChild()
public final String toNormalizedXPathString(int j)
throws NavException
NavException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||