C# Class com.ximpleware.VTDNav

VTD navigator class implementation
Mostrar archivo Open project: jzhang2004/vtd-xml Class Usage Examples

Protected Properties

Property Type Description
LN int
URIName String
XMLDoc IByteBuffer
atTerminal bool
context int[]
contextStack com.ximpleware.ContextBuffer
contextStack2 com.ximpleware.ContextBuffer
count int
currentNode com.ximpleware.BookMark
docLen int
docOffset int
encoding int
fib com.ximpleware.FastIntBuffer
l1Buffer com.ximpleware.FastLongBuffer
l1index int
l2Buffer com.ximpleware.FastLongBuffer
l2index int
l2lower int
l2upper int
l3Buffer com.ximpleware.FastIntBuffer
l3index int
l3lower int
l3upper int
localName String
localNameIndex int
maxLCDepthPlusOne short
name String
nameIndex int
nestingLevel int
ns bool
rootIndex int
shallowDepth bool
stackTemp int[]
vtdBuffer FastLongBuffer
vtdSize int

Public Methods

Method Description
cloneNav ( ) : VTDNav

Duplicate the VTDNav instance with shared XML, VTD and LC buffers This method may be useful for parallel XPath evaluation The node Position is copied over.

compareRawTokenString ( int index, String s ) : int

New in 2.0 Compare the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets compared against This method has to take care of the underlying encoding conversion but it doesn't resolve entity reference in the underlying document The behavior is the same as calling toRawString on index, then compare to s

compareTokenString ( int index, String s ) : int

New in 2.0 Compare the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets matched against This method has to take care of the underlying encoding conversion as well as entity reference comparison

compareTokens ( int i1, VTDNav vn2, int i2 ) : int

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

contains ( int index, String s ) : bool

Test whether a given token contains s. notie that this function directly operates on the byte content of the token to avoid string creation

dumpContext ( ) : void

This method print out the current state info of the navigation object. It is for debugging purpose.

dumpElementFragmentNs ( String fileName ) : void

new in v2.12, dump the element fragment into a file of a given name

dumpFragment ( String fileName ) : void

New in v2.12 Dump an element fragment of xml into an XML file whose name is specified as fileName

dumpFragment ( System os ) : void

New in v2.12 Dump an element fragment of xml into an output stream

dumpFragment ( long l, String fileName ) : void
dumpFragment ( long l, System os ) : void

New in v2.12 Dump a fragement as specified by a long into an output stream

dumpState ( ) : void
dumpXML ( String fileName ) : void

Dump the XML text into a file with the given fileName

dumpXML ( System os ) : void

dump the XML text into a stream

duplicateNav ( ) : VTDNav

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

endsWith ( int index, String s ) : bool

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

expandWhiteSpaces ( long l ) : long

New in v2.12 This method will take a segment descriptor and return a new descriptor that includes all the leading and trailing white spaces around the input segment It has no effect on CDATA A typical usage would be 'expandWhiteSpaces(getElementFragment())'

fillXPathString ( com.ximpleware.FastIntBuffer indexBuffer, com.ximpleware.FastIntBuffer countBuffer ) : void

getAttrCount ( ) : int

Get the number of attributes of a cursor element

getAttrVal ( System an ) : int

Get the token index of the attribute value given an attribute name.

getAttrValNS ( System URL, System ln ) : int

Get the token index of the attribute value of given URL and local name. If ns is not enabled, the lookup will return -1, indicating a no-found. Also namespace nodes are invisible using this method. One can't use * to indicate any name space because * is ambiguous!!

getContentFragment ( ) : long

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

getCurrentDepth ( ) : int

get the depth of context node

getCurrentIndex ( ) : int

Get the index value of the current element. Creation date: (11/16/03 6:40:25 PM)

getElementFragment ( ) : long

Get the starting offset and length of an element encoded in a long, upper 32 bit is length; lower 32 bit is offset Unit is in byte. Creation date: (3/15/04 1:47:55 PM)

getElementFragmentNs ( ) : com.ximpleware.ElementFragmentNs

getEncoding ( ) : int

Get the encoding of the XML document.

getIndexSize ( ) : long

Precompute the size of VTD+XML index without actully generating it

getNestingLevel ( ) : int

Get the maximum nesting depth of the XML document (>0). max depth is nestingLevel -1

getNormalizedStringLength ( int index ) : int

Get the string length of a token as if it is converted into a normalized UCS string

getOffsetAfterHead ( ) : long

getPrefixString ( int i ) : String

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

getRawStringLength ( int index ) : int

Get the string length as if the token is converted into a UCS string (entity not resolved)

getRootIndex ( ) : int

Get root index value , which is the index val of document element

getSiblingElementFragments ( int i ) : long

Return the byte offset and length of up to i sibling fragments. If there is a i+1 sibling element, the cursor element would move to it; otherwise, there is no cursor movement. If the cursor isn't positioned at an element (due to XPath evaluation), then -1 will be returned @param i number of silbing elements including the cursor element @return a long encoding byte offset (bit 31 to bit 0), length (bit 62 to bit 32) of those fragments @throws NavException

getStringLength ( int index ) : int

getStringLength return the string length of a token as if the token is converted into a string (entity resolved)

getText ( ) : int

This method returns of the token index of the type character data or CDATA. Notice that it is intended to support data orient XML (not mixed-content XML). return the index of the text token, or -1 if none exists.

getTokenCount ( ) : int

Get total number of VTD tokens for the current XML document.

getTokenDepth ( int index ) : int

Get the depth value of a token (>=0).

getTokenLength ( int index ) : int

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. When ns is not enabled, return the full name length for attribute name and element name When ns is enabled, return an int with upper 16 bit for prefix length, lower 16 bit for qname length

getTokenOffset ( int index ) : int

Get the starting offset of the token at the given index.

getTokenType ( int index ) : int

Get the token type of the token at the given index value. Creation date: (11/16/03 6:41:51 PM)

getXML ( ) : IByteBuffer

Get the XML document

getXPathStringVal ( short mode ) : String
hasAttr ( System an ) : bool

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)

hasAttrNS ( System URL, System ln ) : bool

Test whether the current element has an attribute with matching namespace URL and localname. If ns is false, return false immediately

matchElement ( System en ) : bool

Test if the current element matches the given name. Creation date: (11/26/03 2:09:43 PM)

matchElementNS ( System URL, System ln ) : bool

Test whether the current element matches the given namespace URL and localname. URL, when set to "*", matches any namespace (including null), when set to null, defines a "always-no-match" ln is the localname that, when set to *, matches any localname

matchRawTokenString ( int index, System s ) : bool

Match the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets matched against This method has to take care of the underlying encoding conversion but it doesn't resolve entity reference in the underlying document

matchTokenString ( int index, System s ) : bool

Match the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets matched against This method has to take care of the underlying encoding conversion as well as entity reference comparison

matchTokens ( int i1, VTDNav vn2, int i2 ) : bool

This method compares two VTD tokens of VTDNav objects

overWrite ( int index, byte ba ) : bool

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" character-by-character, and the remaining "d" is replace with a white space

overWrite ( int index, byte ba, int offset, int len ) : bool

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" character-by-character, and the remaining "d" is replace with a white space

parseDouble ( int index ) : double

Convert a vtd token into a double. Creation date: (12/8/03 2:28:31 PM)

parseFloat ( int index ) : float

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)

parseInt ( int index ) : int

Convert a vtd token into an int. This method will automatically strip off the leading and trailing we assume token type to be attr val or character data zero, unlike Integer.parseInt(int index) Creation date: (12/8/03 2:32:22 PM)

parseLong ( int index ) : long

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)

pop ( ) : bool

Load the context info from ContextBuffer. Info saved including LC and current state of the context Creation date: (11/16/03 6:59:20 PM)

printL2Buffer ( ) : void

Insert the method's description here. Creation date: (3/11/04 1:46:06 PM)

printLC ( ) : void

printLC for debugging purpose. Creation date: (3/12/04 6:07:40 PM)

push ( ) : void

Store the context info into the ContextBuffer. Info saved including LC and current state of the context Creation date: (11/16/03 7:00:27 PM)

recoverNode ( int index ) : void

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

sampleState ( com.ximpleware.FastIntBuffer fib ) : void

This is for debugging purpose

startsWith ( int index, String s ) : bool

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

swap_bytes ( int i ) : int
toElement ( int direction ) : bool

A generic navigation method. Move the current to the element according to the direction constants If no such element, no position change and return false. Creation date: (12/2/03 1:43:50 PM) Legal direction constants are

   			ROOT               0 
 		    PARENT  		   1 
       	    FIRST_CHILD		   2 
 		    LAST_CHILD 		   3 
    	  	    NEXT_SIBLING       4 
      	    PREV_SIBLING       5 

toElement ( int direction, System en ) : bool

A generic navigation method. Move the current to the element according to the direction constants and the element name If no such element, no position change and return false. "*" matches any element Creation date: (12/2/03 1:43:50 PM) Legal direction constants are

		ROOT            0  
		PARENT          1  
		FIRST_CHILD     2  
		LAST_CHILD      3  
		NEXT_SIBLING    4  
		PREV_SIBLING    5  


for ROOT and PARENT, element name will be ignored.

toElementNS ( int direction, System URL, System ln ) : bool

A generic navigation method with namespace support. Move the current to the element according to the direction constants and the prefix and local names If no such element, no position change and return false. URL * matches any namespace, including undefined namespaces a null URL means hte namespace prefix is undefined for the element ln * matches any localname Creation date: (12/2/03 1:43:50 PM) Legal direction constants are

		ROOT            0  
		PARENT          1  
		FIRST_CHILD     2  
		LAST_CHILD      3  
		NEXT_SIBLING    4  
		PREV_SIBLING    5  


for ROOT and PARENT, element name will be ignored. If not ns enabled, return false immediately with no position change.

toNormalizedString ( int index ) : System.String

This method normalizes a token into a string in a way that resembles DOM. The leading and trailing white space characters will be stripped. The entity and character references will be resolved Multiple whitespaces char will be collapsed into one. Whitespaces via entities will nonetheless be preserved. Creation date: (12/8/03 1:57:10 PM)

toNormalizedString2 ( int index ) : String

(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. *For an entity reference, recursively apply step 3 of this algorithm to the replacement text of the entity. *For a white space character (#x20, #xD, #xA, #x9), append a space character (#x20) to the normalized value. *For another character, append the character to the normalized value. @param index @return @throws NavException

toNormalizedXPathString ( int j ) : String
toRawString ( int index ) : System.String

Convert a token at the given index to a String, (built-in entity and char references not resolved) (entities and char references not expanded). Creation date: (11/16/03 7:28:49 PM)

toRawString ( int os, int len ) : System.String

Convert a segment of xml document into string entities not resolved

toRawStringLowerCase ( int index ) : String

Convert a token at the given index to a String, upper case chars get converted into lower case (entities and char references not expanded).

toRawStringUpperCase ( int index ) : String

Convert a token at the given index to a String, lower case chars get converted into upper case (entities and char references not expanded).

toString ( int index ) : System.String

Convert a token at the given index to a String, (entities and char references resolved). An attribute name or an element name will get the UCS2 string of qualified name Creation date: (11/16/03 7:27:19 PM)

toString ( int os, int len ) : System.String

convert the document segment to String, entities resolved

toStringLowerCase ( int index ) : String

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). An attribute name or an element name will get the UCS2 string of qualified name

toStringUpperCase ( int index ) : String

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). An attribute name or an element name will get the UCS2 string of qualified name

trimWhiteSpaces ( long l ) : long

New in v2.12 This method will take a segment descriptor and return a new descriptor that removes all the leading and trailing white spaces around the input segment It has no effect on CDATA

verifyNodeCorrectness ( ) : bool
writeIndex ( System os ) : void

This method writes the VTD+XML into an output streams

writeSeparateIndex ( String fileName ) : void

Write VTDNav's internal structure into an OutputStream (XML not written out)

writeSeparateIndex ( System os ) : void

Write VTDNav's VTD and LCs into an OutputStream (XML not written out)

Protected Methods

Method Description
VTDNav ( ) : System

Return the attribute count of the element at the cursor position. when ns is false, ns tokens are considered attributes; otherwise, ns tokens are not considered attributes

VTDNav ( int RootIndex, int enc, bool NS, int depth, IByteBuffer x, com.ximpleware.FastLongBuffer vtd, com.ximpleware.FastLongBuffer l1, com.ximpleware.FastLongBuffer l2, com.ximpleware.FastIntBuffer l3, int so, int length ) : System

Initialize the VTD navigation object.

XPathStringLength ( int j ) : int
XPathStringVal2Double ( int j ) : double

Convert the string val of an element of document node into a double without first creating teh string object

XPathStringVal_Contains ( int j, String s ) : bool
XPathStringVal_EndsWith ( int j, String s ) : bool

This method is called by ends-with in FuncExpression, it is to perform ends-with on concatnation of text value of an element or document without actually creating the string object.

XPathStringVal_Matches ( int j, String s ) : bool

XPathStringVal_Matches ( int j, VTDNav vn2, int k ) : int

XPathStringVal_StartsWith ( int j, String s ) : bool

clearStack2 ( ) : void

clear the contextStack2 after XPath evaluation

compareNormalizedTokenString2 ( int offset, int len, String s ) : int

compareNormalizedTokenString2

compareRawTokenString ( int offset, int len, String s ) : int

compareTokenString ( int offset, int len, String s ) : int

getCurrentIndex2 ( ) : int
getNextChar ( VTDNav vn, helper h ) : int
getOffsetBeforeTail ( ) : long
getTokenLength2 ( int index ) : int
getXPathStringVal ( ) : String
getXPathStringVal2 ( int j, short mode ) : String
isElement ( int index ) : bool

Test the token type, to see if it is a starting tag.

isElementOrDocument ( int index ) : bool

Test the token type, to see if it is a starting tag or document token (introduced in 1.0).

iterate ( int dp, System en, bool special ) : bool

This method is similar to getElementByName in DOM except it doesn't return the nodeset, instead it iterates over those nodes. Notice that this method is called by the "iterate" method in the Autopilot class. "*" will match any element Creation date: (12/2/03 2:31:20 PM)

iterateNS ( int dp, System URL, System ln ) : bool

This method is similar to getElementByName in DOM except it doesn't return the nodeset, instead it iterates over those nodes . When URL is "*" it will match any namespace if ns is false, return false immediately

iterateNode ( int dp ) : bool
iterate_following ( System en, bool special ) : bool

This function is called by selectElement_F in autoPilot

iterate_followingNS ( System URL, System ln ) : bool

This function is called by selectElementNS_F in autoPilot

iterate_following_node ( ) : bool
iterate_preceding ( System en, int a, int endIndex ) : bool

This function is called by selectElement_P in autoPilot

iterate_precedingNS ( System URL, System ln, int a, int endIndex ) : bool

This function is called by selectElementNS_P in autoPilot

iterate_preceding_node ( int a, int endIndex ) : bool
loadCurrentNode ( ) : void
lookupNS ( ) : int

Test whether the URL is defined in the scope. Null is allowed to indicate the name space is undefined. Creation date: (11/16/03 7:54:01 PM)

lookupNS ( int offset, int len ) : int

matchNormalizedTokenString2 ( int index, String s ) : bool

matchRawTokenString2 ( int index, String s ) : bool

nodeToElement ( int direction ) : bool
parseInt ( int index, int radix ) : int

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)

parseLong ( int index, int radix ) : long

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)

pop2 ( ) : bool

Load the context info from contextStack2. This method is dedicated for XPath evaluation.

push2 ( ) : void

Store the context info into the contextStack2. This method is reserved for XPath Evaluation

recoverNode_l1 ( int index ) : void

recoverNode_l2 ( int index ) : void

recoverNode_l3 ( int index ) : void

resolveLC ( ) : void

Sync up the current context with location cache. This operation includes finding out l1index, l2index, l3index and restores upper and lower bound info To improve efficieny this method employs some heuristic search algorithm. The result is that it is quite close to direct access. Creation date: (11/16/03 7:44:53 PM)

resolveLC_l1 ( ) : void
resolveLC_l2 ( ) : void
resolveLC_l3 ( ) : void
sync ( int depth, int index ) : void
toNode ( int dir ) : bool
toNode_LastChild ( ) : bool
toNode_PrevSibling ( ) : bool
toRawString ( int os, int len, System sb ) : void
toRawStringLowerCase ( int os, int len ) : String

toRawStringLowerCase ( int os, int len, StringBuilder sb ) : void
toRawStringUpperCase ( int os, int len ) : String

toRawStringUpperCase ( int os, int len, StringBuilder sb ) : void
toString ( System sb, int index ) : void

toString ( int os, int len, System sb ) : void
toStringLowerCase ( int os, int len ) : String

Convert the byte content segment (in terms of offset and length) to String, upper case characters are converted to lower case Notice this is more efficient than call toString, then can toLowerCase

toStringLowerCase ( StringBuilder sb, int index ) : void
toStringLowerCase ( int os, int len, StringBuilder sb ) : void
toStringUpperCase ( int os, int len ) : String

Convert the byte content segment (in terms of offset and length) to String, lower case characters are converted to upper case

toStringUpperCase ( StringBuilder sb, int index ) : void
toStringUpperCase ( int os, int len, StringBuilder sb ) : void

Private Methods

Method Description
NSval ( int i ) : int

Evaluate the namespace indicator in bit 31 and bit 30. Creation date: (11/27/03 5:38:51 PM)

decode ( int offset ) : int
getChar ( int offset ) : long

This method decodes the underlying byte array into corresponding UCS2 char representation . It doesn't resolves built-in entity and character references. Length will never be zero Creation date: (11/21/03 6:26:17 PM)

getChar4OtherEncoding ( int offset ) : long
getCharResolved ( int offset ) : long

This method decodes the underlying byte array into corresponding UCS2 char representation . Also it resolves built-in entity and character references.

getCharUnit ( int offset ) : int

Get the next char unit which gets decoded automatically

handle_utf16be ( int offset ) : long
handle_utf16le ( int offset ) : long
handle_utf8 ( long temp, int offset ) : long
isDigit ( int c ) : bool
isWS ( int ch ) : bool

Test whether ch is a white space character or not.

matchRawTokenString ( int offset, int len, System s ) : bool

Match a string against a token with given offset and len, entities doesn't get resolved.

matchRawTokenString ( long l, System s ) : bool

Match a string with a token represented by a long (upper 32 len, lower 32 offset).

matchSubString ( int os, int index, String s ) : bool
matchSubString2 ( int os, int index, String s ) : bool
matchTokenString ( int offset, int len, System s ) : bool

Match a string against a token with given offset and len, entities get resolved properly. Creation date: (11/24/03 1:37:42 PM)

matchTokenString ( long l, System s ) : bool

Match a string against a "non-extractive" token represented by a long (upper 32 len, lower 32 offset).

resolveNS ( System URL, int offset, int len ) : bool

Test whether the URL is defined in the document. Null is allowed to indicate the name space should be undefined. Creation date: (11/16/03 7:54:01 PM)

Method Details

VTDNav() protected method

Return the attribute count of the element at the cursor position. when ns is false, ns tokens are considered attributes; otherwise, ns tokens are not considered attributes
protected VTDNav ( ) : System
return System

VTDNav() protected method

Initialize the VTD navigation object.
protected VTDNav ( int RootIndex, int enc, bool NS, int depth, IByteBuffer x, com.ximpleware.FastLongBuffer vtd, com.ximpleware.FastLongBuffer l1, com.ximpleware.FastLongBuffer l2, com.ximpleware.FastIntBuffer l3, int so, int length ) : System
RootIndex int int ///
enc int
NS bool boolean ///
depth int
x IByteBuffer byte[] ///
vtd com.ximpleware.FastLongBuffer com.ximpleware.ILongBuffer ///
l1 com.ximpleware.FastLongBuffer com.ximpleware.ILongBuffer ///
l2 com.ximpleware.FastLongBuffer com.ximpleware.ILongBuffer ///
l3 com.ximpleware.FastIntBuffer com.ximpleware.IIntBuffer ///
so int int starting offset of the document(in byte) ///
length int int length of the document (in byte) ///
return System

XPathStringLength() protected method

protected XPathStringLength ( int j ) : int
j int
return int

XPathStringVal2Double() protected method

Convert the string val of an element of document node into a double without first creating teh string object
protected XPathStringVal2Double ( int j ) : double
j int
return double

XPathStringVal_Contains() protected method

protected XPathStringVal_Contains ( int j, String s ) : bool
j int
s String
return bool

XPathStringVal_EndsWith() protected method

This method is called by ends-with in FuncExpression, it is to perform ends-with on concatnation of text value of an element or document without actually creating the string object.
protected XPathStringVal_EndsWith ( int j, String s ) : bool
j int
s String
return bool

XPathStringVal_Matches() protected method

protected XPathStringVal_Matches ( int j, String s ) : bool
j int
s String
return bool

XPathStringVal_Matches() protected method

protected XPathStringVal_Matches ( int j, VTDNav vn2, int k ) : int
j int
vn2 VTDNav
k int
return int

XPathStringVal_StartsWith() protected method

protected XPathStringVal_StartsWith ( int j, String s ) : bool
j int
s String
return bool

clearStack2() protected method

clear the contextStack2 after XPath evaluation
protected clearStack2 ( ) : void
return void

cloneNav() public method

Duplicate the VTDNav instance with shared XML, VTD and LC buffers This method may be useful for parallel XPath evaluation The node Position is copied over.
public cloneNav ( ) : VTDNav
return VTDNav

compareNormalizedTokenString2() protected method

compareNormalizedTokenString2
protected compareNormalizedTokenString2 ( int offset, int len, String s ) : int
offset int
len int
s String
return int

compareRawTokenString() public method

New in 2.0 Compare the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets compared against This method has to take care of the underlying encoding conversion but it doesn't resolve entity reference in the underlying document The behavior is the same as calling toRawString on index, then compare to s
public compareRawTokenString ( int index, String s ) : int
index int
s String
return int

compareRawTokenString() protected method

protected compareRawTokenString ( int offset, int len, String s ) : int
offset int
len int
s String
return int

compareTokenString() public method

New in 2.0 Compare the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets matched against This method has to take care of the underlying encoding conversion as well as entity reference comparison
public compareTokenString ( int index, String s ) : int
index int
s String
return int

compareTokenString() protected method

protected compareTokenString ( int offset, int len, String s ) : int
offset int
len int
s String
return int

compareTokens() public method

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
public compareTokens ( int i1, VTDNav vn2, int i2 ) : int
i1 int
vn2 VTDNav
i2 int
return int

contains() public method

Test whether a given token contains s. notie that this function directly operates on the byte content of the token to avoid string creation
public contains ( int index, String s ) : bool
index int
s String
return bool

dumpContext() public method

This method print out the current state info of the navigation object. It is for debugging purpose.
public dumpContext ( ) : void
return void

dumpElementFragmentNs() public method

new in v2.12, dump the element fragment into a file of a given name
public dumpElementFragmentNs ( String fileName ) : void
fileName String
return void

dumpFragment() public method

New in v2.12 Dump an element fragment of xml into an XML file whose name is specified as fileName
public dumpFragment ( String fileName ) : void
fileName String
return void

dumpFragment() public method

New in v2.12 Dump an element fragment of xml into an output stream
public dumpFragment ( System os ) : void
os System
return void

dumpFragment() public method

public dumpFragment ( long l, String fileName ) : void
l long
fileName String
return void

dumpFragment() public method

New in v2.12 Dump a fragement as specified by a long into an output stream
public dumpFragment ( long l, System os ) : void
l long
os System
return void

dumpState() public method

public dumpState ( ) : void
return void

dumpXML() public method

Dump the XML text into a file with the given fileName
public dumpXML ( String fileName ) : void
fileName String
return void

dumpXML() public method

dump the XML text into a stream
public dumpXML ( System os ) : void
os System output stream
return void

duplicateNav() public method

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
public duplicateNav ( ) : VTDNav
return VTDNav

endsWith() public method

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
public endsWith ( int index, String s ) : bool
index int
s String
return bool

expandWhiteSpaces() public method

New in v2.12 This method will take a segment descriptor and return a new descriptor that includes all the leading and trailing white spaces around the input segment It has no effect on CDATA A typical usage would be 'expandWhiteSpaces(getElementFragment())'
public expandWhiteSpaces ( long l ) : long
l long
return long

fillXPathString() public method

public fillXPathString ( com.ximpleware.FastIntBuffer indexBuffer, com.ximpleware.FastIntBuffer countBuffer ) : void
indexBuffer com.ximpleware.FastIntBuffer
countBuffer com.ximpleware.FastIntBuffer
return void

getAttrCount() public method

Get the number of attributes of a cursor element
public getAttrCount ( ) : int
return int

getAttrVal() public method

Get the token index of the attribute value given an attribute name.
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. ///
public getAttrVal ( System an ) : int
an System String ///
return int

getAttrValNS() public method

Get the token index of the attribute value of given URL and local name. If ns is not enabled, the lookup will return -1, indicating a no-found. Also namespace nodes are invisible using this method. One can't use * to indicate any name space because * is ambiguous!!
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. ///
public getAttrValNS ( System URL, System ln ) : int
URL System String (Name space URL) ///
ln System String (local name) ///
return int

getContentFragment() public method

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
public getContentFragment ( ) : long
return long

getCurrentDepth() public method

get the depth of context node
public getCurrentDepth ( ) : int
return int

getCurrentIndex() public method

Get the index value of the current element. Creation date: (11/16/03 6:40:25 PM)
public getCurrentIndex ( ) : int
return int

getCurrentIndex2() protected method

protected getCurrentIndex2 ( ) : int
return int

getElementFragment() public method

Get the starting offset and length of an element encoded in a long, upper 32 bit is length; lower 32 bit is offset Unit is in byte. Creation date: (3/15/04 1:47:55 PM)
public getElementFragment ( ) : long
return long

getElementFragmentNs() public method

public getElementFragmentNs ( ) : com.ximpleware.ElementFragmentNs
return com.ximpleware.ElementFragmentNs

getEncoding() public method

Get the encoding of the XML document.
public getEncoding ( ) : int
return int

getIndexSize() public method

Precompute the size of VTD+XML index without actully generating it
public getIndexSize ( ) : long
return long

getNestingLevel() public method

Get the maximum nesting depth of the XML document (>0). max depth is nestingLevel -1
public getNestingLevel ( ) : int
return int

getNextChar() protected method

protected getNextChar ( VTDNav vn, helper h ) : int
vn VTDNav
h helper
return int

getNormalizedStringLength() public method

Get the string length of a token as if it is converted into a normalized UCS string
public getNormalizedStringLength ( int index ) : int
index int
return int

getOffsetAfterHead() public method

public getOffsetAfterHead ( ) : long
return long

getOffsetBeforeTail() protected method

protected getOffsetBeforeTail ( ) : long
return long

getPrefixString() public method

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
public getPrefixString ( int i ) : String
i int VTD index of a token
return String

getRawStringLength() public method

Get the string length as if the token is converted into a UCS string (entity not resolved)
public getRawStringLength ( int index ) : int
index int
return int

getRootIndex() public method

Get root index value , which is the index val of document element
public getRootIndex ( ) : int
return int

getSiblingElementFragments() public method

Return the byte offset and length of up to i sibling fragments. If there is a i+1 sibling element, the cursor element would move to it; otherwise, there is no cursor movement. If the cursor isn't positioned at an element (due to XPath evaluation), then -1 will be returned @param i number of silbing elements including the cursor element @return a long encoding byte offset (bit 31 to bit 0), length (bit 62 to bit 32) of those fragments @throws NavException
public getSiblingElementFragments ( int i ) : long
i int
return long

getStringLength() public method

getStringLength return the string length of a token as if the token is converted into a string (entity resolved)
public getStringLength ( int index ) : int
index int
return int

getText() public method

This method returns of the token index of the type character data or CDATA. Notice that it is intended to support data orient XML (not mixed-content XML). return the index of the text token, or -1 if none exists.
public getText ( ) : int
return int

getTokenCount() public method

Get total number of VTD tokens for the current XML document.
public getTokenCount ( ) : int
return int

getTokenDepth() public method

Get the depth value of a token (>=0).
public getTokenDepth ( int index ) : int
index int int ///
return int

getTokenLength() public method

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. When ns is not enabled, return the full name length for attribute name and element name When ns is enabled, return an int with upper 16 bit for prefix length, lower 16 bit for qname length
public getTokenLength ( int index ) : int
index int int ///
return int

getTokenLength2() protected method

protected getTokenLength2 ( int index ) : int
index int
return int

getTokenOffset() public method

Get the starting offset of the token at the given index.
///
public getTokenOffset ( int index ) : int
index int int ///
return int

getTokenType() public method

Get the token type of the token at the given index value. Creation date: (11/16/03 6:41:51 PM)
///
public getTokenType ( int index ) : int
index int int ///
return int

getXML() public method

Get the XML document
public getXML ( ) : IByteBuffer
return IByteBuffer

getXPathStringVal() protected method

protected getXPathStringVal ( ) : String
return String

getXPathStringVal() public method

public getXPathStringVal ( short mode ) : String
mode short
return String

getXPathStringVal2() protected method

protected getXPathStringVal2 ( int j, short mode ) : String
j int
mode short
return String

hasAttr() public method

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)
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. ///
public hasAttr ( System an ) : bool
an System String ///
return bool

hasAttrNS() public method

Test whether the current element has an attribute with matching namespace URL and localname. If ns is false, return false immediately
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 hasAttrNS ( System URL, System ln ) : bool
URL System String (namespace URL) ///
ln System String (localname ) ///
return bool

isElement() protected method

Test the token type, to see if it is a starting tag.
protected isElement ( int index ) : bool
index int int ///
return bool

isElementOrDocument() protected method

Test the token type, to see if it is a starting tag or document token (introduced in 1.0).
protected isElementOrDocument ( int index ) : bool
index int int ///
return bool

iterate() protected method

This method is similar to getElementByName in DOM except it doesn't return the nodeset, instead it iterates over those nodes. Notice that this method is called by the "iterate" method in the Autopilot class. "*" will match any element Creation date: (12/2/03 2:31:20 PM)
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 iterate ( int dp, System en, bool special ) : bool
dp int int (The depth of the starting position before iterating) ///
en System String ///
special bool
return bool

iterateNS() protected method

This method is similar to getElementByName in DOM except it doesn't return the nodeset, instead it iterates over those nodes . When URL is "*" it will match any namespace if ns is false, return false immediately
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.. ///
protected iterateNS ( int dp, System URL, System ln ) : bool
dp int int (The depth of the starting position before iterating) ///
URL System String ///
ln System String ///
return bool

iterateNode() protected method

protected iterateNode ( int dp ) : bool
dp int
return bool

iterate_following() protected method

This function is called by selectElement_F in autoPilot
protected iterate_following ( System en, bool special ) : bool
en System ElementName ///
special bool whether it is a node() ///
return bool

iterate_followingNS() protected method

This function is called by selectElementNS_F in autoPilot
protected iterate_followingNS ( System URL, System ln ) : bool
URL System ///
ln System ///
return bool

iterate_following_node() protected method

protected iterate_following_node ( ) : bool
return bool

iterate_preceding() protected method

This function is called by selectElement_P in autoPilot
protected iterate_preceding ( System en, int a, int endIndex ) : bool
en System element Name ///
a int context of current position ///
endIndex int ///
return bool

iterate_precedingNS() protected method

This function is called by selectElementNS_P in autoPilot
protected iterate_precedingNS ( System URL, System ln, int a, int endIndex ) : bool
URL System ///
ln System ///
a int
endIndex int
return bool

iterate_preceding_node() protected method

protected iterate_preceding_node ( int a, int endIndex ) : bool
a int
endIndex int
return bool

loadCurrentNode() protected method

protected loadCurrentNode ( ) : void
return void

lookupNS() protected method

Test whether the URL is defined in the scope. Null is allowed to indicate the name space is undefined. Creation date: (11/16/03 7:54:01 PM)
When there is any encoding conversion error or unknown /// entity. ///
protected lookupNS ( ) : int
return int

lookupNS() protected method

protected lookupNS ( int offset, int len ) : int
offset int
len int
return int

matchElement() public method

Test if the current element matches the given name. Creation date: (11/26/03 2:09:43 PM)
If the underlying raw char representation has errors. /// if en is null ///
public matchElement ( System en ) : bool
en System String ///
return bool

matchElementNS() public method

Test whether the current element matches the given namespace URL and localname. URL, when set to "*", matches any namespace (including null), when set to null, defines a "always-no-match" ln is the localname that, when set to *, matches any localname
When there is any encoding conversion error or unknown entity. /// if ln == null ///
public matchElementNS ( System URL, System ln ) : bool
URL System String ///
ln System String ///
return bool

matchNormalizedTokenString2() protected method

protected matchNormalizedTokenString2 ( int index, String s ) : bool
index int
s String
return bool

matchRawTokenString() public method

Match the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets matched against This method has to take care of the underlying encoding conversion but it doesn't resolve entity reference in the underlying document
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 matchRawTokenString ( int index, System s ) : bool
index int int (index into the VTD token buffer) ///
s System String ///
return bool

matchRawTokenString2() protected method

protected matchRawTokenString2 ( int index, String s ) : bool
index int
s String
return bool

matchTokenString() public method

Match the string against the token at the given index value. When a token is an attribute name or starting tag, qualified name is what gets matched against This method has to take care of the underlying encoding conversion as well as entity reference comparison
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 matchTokenString ( int index, System s ) : bool
index int int ///
s System String ///
return bool

matchTokens() public method

This method compares two VTD tokens of VTDNav objects
public matchTokens ( int i1, VTDNav vn2, int i2 ) : bool
i1 int ///
vn2 VTDNav ///
i2 int ///
return bool

nodeToElement() protected method

protected nodeToElement ( int direction ) : bool
direction int
return bool

overWrite() public method

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" character-by-character, and the remaining "d" is replace with a white space
public overWrite ( int index, byte ba ) : bool
index int
ba byte
return bool

overWrite() public method

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" character-by-character, and the remaining "d" is replace with a white space
public overWrite ( int index, byte ba, int offset, int len ) : bool
index int
ba byte
offset int
len int
return bool

parseDouble() public method

Convert a vtd token into a double. Creation date: (12/8/03 2:28:31 PM)
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 parseDouble ( int index ) : double
index int
return double

parseFloat() public method

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)
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 parseFloat ( int index ) : float
index int
return float

parseInt() public method

Convert a vtd token into an int. This method will automatically strip off the leading and trailing we assume token type to be attr val or character data zero, unlike Integer.parseInt(int index) Creation date: (12/8/03 2:32:22 PM)
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 parseInt ( int index ) : int
index int int ///
return int

parseInt() protected method

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)
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 parseInt ( int index, int radix ) : int
index int int ///
radix int int ///
return int

parseLong() public method

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)
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 parseLong ( int index ) : long
index int int ///
return long

parseLong() protected method

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)
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 parseLong ( int index, int radix ) : long
index int int ///
radix int int ///
return long

pop() public method

Load the context info from ContextBuffer. Info saved including LC and current state of the context Creation date: (11/16/03 6:59:20 PM)
public pop ( ) : bool
return bool

pop2() protected method

Load the context info from contextStack2. This method is dedicated for XPath evaluation.
protected pop2 ( ) : bool
return bool

printL2Buffer() public method

Insert the method's description here. Creation date: (3/11/04 1:46:06 PM)
public printL2Buffer ( ) : void
return void

printLC() public method

printLC for debugging purpose. Creation date: (3/12/04 6:07:40 PM)
public printLC ( ) : void
return void

push() public method

Store the context info into the ContextBuffer. Info saved including LC and current state of the context Creation date: (11/16/03 7:00:27 PM)
public push ( ) : void
return void

push2() protected method

Store the context info into the contextStack2. This method is reserved for XPath Evaluation
protected push2 ( ) : void
return void

recoverNode() public method

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
public recoverNode ( int index ) : void
index int
return void

recoverNode_l1() protected method

protected recoverNode_l1 ( int index ) : void
index int
return void

recoverNode_l2() protected method

protected recoverNode_l2 ( int index ) : void
index int
return void

recoverNode_l3() protected method

protected recoverNode_l3 ( int index ) : void
index int
return void

resolveLC() protected method

Sync up the current context with location cache. This operation includes finding out l1index, l2index, l3index and restores upper and lower bound info To improve efficieny this method employs some heuristic search algorithm. The result is that it is quite close to direct access. Creation date: (11/16/03 7:44:53 PM)
protected resolveLC ( ) : void
return void

resolveLC_l1() protected method

protected resolveLC_l1 ( ) : void
return void

resolveLC_l2() protected method

protected resolveLC_l2 ( ) : void
return void

resolveLC_l3() protected method

protected resolveLC_l3 ( ) : void
return void

sampleState() public method

This is for debugging purpose
public sampleState ( com.ximpleware.FastIntBuffer fib ) : void
fib com.ximpleware.FastIntBuffer ///
return void

startsWith() public method

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
public startsWith ( int index, String s ) : bool
index int
s String
return bool

swap_bytes() static public method

static public swap_bytes ( int i ) : int
i int
return int

sync() protected method

protected sync ( int depth, int index ) : void
depth int
index int
return void

toElement() public method

A generic navigation method. Move the current to the element according to the direction constants If no such element, no position change and return false. Creation date: (12/2/03 1:43:50 PM) Legal direction constants are
   			ROOT               0 
 		    PARENT  		   1 
       	    FIRST_CHILD		   2 
 		    LAST_CHILD 		   3 
    	  	    NEXT_SIBLING       4 
      	    PREV_SIBLING       5 
When direction value is illegal. ///
public toElement ( int direction ) : bool
direction int int ///
return bool

toElement() public method

A generic navigation method. Move the current to the element according to the direction constants and the element name If no such element, no position change and return false. "*" matches any element Creation date: (12/2/03 1:43:50 PM) Legal direction constants are

		ROOT            0  
		PARENT          1  
		FIRST_CHILD     2  
		LAST_CHILD      3  
		NEXT_SIBLING    4  
		PREV_SIBLING    5  


for ROOT and PARENT, element name will be ignored.
When direction value is illegal. Or there are errors /// in underlying byte representation of the document /// if en is null ///
public toElement ( int direction, System en ) : bool
direction int int ///
en System String ///
return bool

toElementNS() public method

A generic navigation method with namespace support. Move the current to the element according to the direction constants and the prefix and local names If no such element, no position change and return false. URL * matches any namespace, including undefined namespaces a null URL means hte namespace prefix is undefined for the element ln * matches any localname Creation date: (12/2/03 1:43:50 PM) Legal direction constants are

		ROOT            0  
		PARENT          1  
		FIRST_CHILD     2  
		LAST_CHILD      3  
		NEXT_SIBLING    4  
		PREV_SIBLING    5  


for ROOT and PARENT, element name will be ignored. If not ns enabled, return false immediately with no position change.
When direction value is illegal. Or there are errors /// in underlying byte representation of the document ///
public toElementNS ( int direction, System URL, System ln ) : bool
direction int int ///
URL System namespace URL
ln System local name ///
return bool

toNode() protected method

protected toNode ( int dir ) : bool
dir int
return bool

toNode_LastChild() protected method

protected toNode_LastChild ( ) : bool
return bool

toNode_PrevSibling() protected method

protected toNode_PrevSibling ( ) : bool
return bool

toNormalizedString() public method

This method normalizes a token into a string in a way that resembles DOM. The leading and trailing white space characters will be stripped. The entity and character references will be resolved Multiple whitespaces char will be collapsed into one. Whitespaces via entities will nonetheless be preserved. Creation date: (12/8/03 1:57:10 PM)
When the encoding has errors ///
public toNormalizedString ( int index ) : System.String
index int int ///
return System.String

toNormalizedString2() public method

(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. *For an entity reference, recursively apply step 3 of this algorithm to the replacement text of the entity. *For a white space character (#x20, #xD, #xA, #x9), append a space character (#x20) to the normalized value. *For another character, append the character to the normalized value. @param index @return @throws NavException
public toNormalizedString2 ( int index ) : String
index int
return String

toNormalizedXPathString() public method

public toNormalizedXPathString ( int j ) : String
j int
return String

toRawString() public method

Convert a token at the given index to a String, (built-in entity and char references not resolved) (entities and char references not expanded). Creation date: (11/16/03 7:28:49 PM)
When the encoding has errors ///
public toRawString ( int index ) : System.String
index int int ///
return System.String

toRawString() public method

Convert a segment of xml document into string entities not resolved
public toRawString ( int os, int len ) : System.String
os int os in char
len int len in char
return System.String

toRawString() protected method

protected toRawString ( int os, int len, System sb ) : void
os int
len int
sb System
return void

toRawStringLowerCase() public method

Convert a token at the given index to a String, upper case chars get converted into lower case (entities and char references not expanded).
public toRawStringLowerCase ( int index ) : String
index int
return String

toRawStringLowerCase() protected method

protected toRawStringLowerCase ( int os, int len ) : String
os int
len int
return String

toRawStringLowerCase() protected method

protected toRawStringLowerCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
return void

toRawStringUpperCase() public method

Convert a token at the given index to a String, lower case chars get converted into upper case (entities and char references not expanded).
public toRawStringUpperCase ( int index ) : String
index int VTD index
return String

toRawStringUpperCase() protected method

protected toRawStringUpperCase ( int os, int len ) : String
os int
len int
return String

toRawStringUpperCase() protected method

protected toRawStringUpperCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
return void

toString() public method

Convert a token at the given index to a String, (entities and char references resolved). An attribute name or an element name will get the UCS2 string of qualified name Creation date: (11/16/03 7:27:19 PM)
///
public toString ( int index ) : System.String
index int
return System.String

toString() public method

convert the document segment to String, entities resolved
public toString ( int os, int len ) : System.String
os int offset in char
len int length in char
return System.String

toString() protected method

protected toString ( System sb, int index ) : void
sb System
index int
return void

toString() protected method

protected toString ( int os, int len, System sb ) : void
os int
len int
sb System
return void

toStringLowerCase() public method

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). An attribute name or an element name will get the UCS2 string of qualified name
public toStringLowerCase ( int index ) : String
index int
return String

toStringLowerCase() protected method

Convert the byte content segment (in terms of offset and length) to String, upper case characters are converted to lower case Notice this is more efficient than call toString, then can toLowerCase
protected toStringLowerCase ( int os, int len ) : String
os int
len int
return String

toStringLowerCase() protected method

protected toStringLowerCase ( StringBuilder sb, int index ) : void
sb StringBuilder
index int
return void

toStringLowerCase() protected method

protected toStringLowerCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
return void

toStringUpperCase() public method

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). An attribute name or an element name will get the UCS2 string of qualified name
public toStringUpperCase ( int index ) : String
index int
return String

toStringUpperCase() protected method

Convert the byte content segment (in terms of offset and length) to String, lower case characters are converted to upper case
protected toStringUpperCase ( int os, int len ) : String
os int
len int
return String

toStringUpperCase() protected method

protected toStringUpperCase ( StringBuilder sb, int index ) : void
sb StringBuilder
index int
return void

toStringUpperCase() protected method

protected toStringUpperCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
return void

trimWhiteSpaces() public method

New in v2.12 This method will take a segment descriptor and return a new descriptor that removes all the leading and trailing white spaces around the input segment It has no effect on CDATA
public trimWhiteSpaces ( long l ) : long
l long
return long

verifyNodeCorrectness() public method

public verifyNodeCorrectness ( ) : bool
return bool

writeIndex() public method

This method writes the VTD+XML into an output streams
public writeIndex ( System os ) : void
os System ///
return void

writeSeparateIndex() public method

Write VTDNav's internal structure into an OutputStream (XML not written out)
public writeSeparateIndex ( String fileName ) : void
fileName String
return void

writeSeparateIndex() public method

Write VTDNav's VTD and LCs into an OutputStream (XML not written out)
public writeSeparateIndex ( System os ) : void
os System
return void

Property Details

LN protected_oe property

protected int LN
return int

URIName protected_oe property

protected String URIName
return String

XMLDoc protected_oe property

protected IByteBuffer XMLDoc
return IByteBuffer

atTerminal protected_oe property

protected bool atTerminal
return bool

context protected_oe property

protected int[] context
return int[]

contextStack protected_oe property

protected ContextBuffer,com.ximpleware contextStack
return com.ximpleware.ContextBuffer

contextStack2 protected_oe property

protected ContextBuffer,com.ximpleware contextStack2
return com.ximpleware.ContextBuffer

count protected_oe property

protected int count
return int

currentNode protected_oe property

protected BookMark,com.ximpleware currentNode
return com.ximpleware.BookMark

docLen protected_oe property

protected int docLen
return int

docOffset protected_oe property

protected int docOffset
return int

encoding protected_oe property

protected int encoding
return int

fib protected_oe property

protected FastIntBuffer,com.ximpleware fib
return com.ximpleware.FastIntBuffer

l1Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l1Buffer
return com.ximpleware.FastLongBuffer

l1index protected_oe property

protected int l1index
return int

l2Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l2Buffer
return com.ximpleware.FastLongBuffer

l2index protected_oe property

protected int l2index
return int

l2lower protected_oe property

protected int l2lower
return int

l2upper protected_oe property

protected int l2upper
return int

l3Buffer protected_oe property

protected FastIntBuffer,com.ximpleware l3Buffer
return com.ximpleware.FastIntBuffer

l3index protected_oe property

protected int l3index
return int

l3lower protected_oe property

protected int l3lower
return int

l3upper protected_oe property

protected int l3upper
return int

localName protected_oe property

protected String localName
return String

localNameIndex protected_oe property

protected int localNameIndex
return int

maxLCDepthPlusOne protected_oe property

protected short maxLCDepthPlusOne
return short

name protected_oe property

protected String name
return String

nameIndex protected_oe property

protected int nameIndex
return int

nestingLevel protected_oe property

protected int nestingLevel
return int

ns protected_oe property

protected bool ns
return bool

rootIndex protected_oe property

protected int rootIndex
return int

shallowDepth protected_oe property

protected bool shallowDepth
return bool

stackTemp protected_oe property

protected int[] stackTemp
return int[]

vtdBuffer protected_oe property

protected FastLongBuffer vtdBuffer
return FastLongBuffer

vtdSize protected_oe property

protected int vtdSize
return int