C# Class com.ximpleware.VTDNav

VTD navigator class implementation
Afficher le fichier Open project: jzhang2004/vtd-xml Class Usage Examples

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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)

Méthodes protégées

Méthode 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

Méthode 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 méthode

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
Résultat System

VTDNav() protected méthode

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) ///
Résultat System

XPathStringLength() protected méthode

protected XPathStringLength ( int j ) : int
j int
Résultat int

XPathStringVal2Double() protected méthode

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
Résultat double

XPathStringVal_Contains() protected méthode

protected XPathStringVal_Contains ( int j, String s ) : bool
j int
s String
Résultat bool

XPathStringVal_EndsWith() protected méthode

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
Résultat bool

XPathStringVal_Matches() protected méthode

protected XPathStringVal_Matches ( int j, String s ) : bool
j int
s String
Résultat bool

XPathStringVal_Matches() protected méthode

protected XPathStringVal_Matches ( int j, VTDNav vn2, int k ) : int
j int
vn2 VTDNav
k int
Résultat int

XPathStringVal_StartsWith() protected méthode

protected XPathStringVal_StartsWith ( int j, String s ) : bool
j int
s String
Résultat bool

clearStack2() protected méthode

clear the contextStack2 after XPath evaluation
protected clearStack2 ( ) : void
Résultat void

cloneNav() public méthode

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
Résultat VTDNav

compareNormalizedTokenString2() protected méthode

compareNormalizedTokenString2
protected compareNormalizedTokenString2 ( int offset, int len, String s ) : int
offset int
len int
s String
Résultat int

compareRawTokenString() public méthode

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
Résultat int

compareRawTokenString() protected méthode

protected compareRawTokenString ( int offset, int len, String s ) : int
offset int
len int
s String
Résultat int

compareTokenString() public méthode

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
Résultat int

compareTokenString() protected méthode

protected compareTokenString ( int offset, int len, String s ) : int
offset int
len int
s String
Résultat int

compareTokens() public méthode

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
Résultat int

contains() public méthode

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
Résultat bool

dumpContext() public méthode

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

dumpElementFragmentNs() public méthode

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

dumpFragment() public méthode

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
Résultat void

dumpFragment() public méthode

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

dumpFragment() public méthode

public dumpFragment ( long l, String fileName ) : void
l long
fileName String
Résultat void

dumpFragment() public méthode

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
Résultat void

dumpState() public méthode

public dumpState ( ) : void
Résultat void

dumpXML() public méthode

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

dumpXML() public méthode

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

duplicateNav() public méthode

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
Résultat VTDNav

endsWith() public méthode

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
Résultat bool

expandWhiteSpaces() public méthode

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
Résultat long

fillXPathString() public méthode

public fillXPathString ( com.ximpleware.FastIntBuffer indexBuffer, com.ximpleware.FastIntBuffer countBuffer ) : void
indexBuffer com.ximpleware.FastIntBuffer
countBuffer com.ximpleware.FastIntBuffer
Résultat void

getAttrCount() public méthode

Get the number of attributes of a cursor element
public getAttrCount ( ) : int
Résultat int

getAttrVal() public méthode

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 ///
Résultat int

getAttrValNS() public méthode

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) ///
Résultat int

getContentFragment() public méthode

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
Résultat long

getCurrentDepth() public méthode

get the depth of context node
public getCurrentDepth ( ) : int
Résultat int

getCurrentIndex() public méthode

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

getCurrentIndex2() protected méthode

protected getCurrentIndex2 ( ) : int
Résultat int

getElementFragment() public méthode

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
Résultat long

getElementFragmentNs() public méthode

public getElementFragmentNs ( ) : com.ximpleware.ElementFragmentNs
Résultat com.ximpleware.ElementFragmentNs

getEncoding() public méthode

Get the encoding of the XML document.
public getEncoding ( ) : int
Résultat int

getIndexSize() public méthode

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

getNestingLevel() public méthode

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

getNextChar() protected méthode

protected getNextChar ( VTDNav vn, helper h ) : int
vn VTDNav
h helper
Résultat int

getNormalizedStringLength() public méthode

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

getOffsetAfterHead() public méthode

public getOffsetAfterHead ( ) : long
Résultat long

getOffsetBeforeTail() protected méthode

protected getOffsetBeforeTail ( ) : long
Résultat long

getPrefixString() public méthode

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
Résultat String

getRawStringLength() public méthode

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

getRootIndex() public méthode

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

getSiblingElementFragments() public méthode

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
Résultat long

getStringLength() public méthode

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
Résultat int

getText() public méthode

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
Résultat int

getTokenCount() public méthode

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

getTokenDepth() public méthode

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

getTokenLength() public méthode

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 ///
Résultat int

getTokenLength2() protected méthode

protected getTokenLength2 ( int index ) : int
index int
Résultat int

getTokenOffset() public méthode

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

getTokenType() public méthode

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 ///
Résultat int

getXML() public méthode

Get the XML document
public getXML ( ) : IByteBuffer
Résultat IByteBuffer

getXPathStringVal() protected méthode

protected getXPathStringVal ( ) : String
Résultat String

getXPathStringVal() public méthode

public getXPathStringVal ( short mode ) : String
mode short
Résultat String

getXPathStringVal2() protected méthode

protected getXPathStringVal2 ( int j, short mode ) : String
j int
mode short
Résultat String

hasAttr() public méthode

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 ///
Résultat bool

hasAttrNS() public méthode

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 ) ///
Résultat bool

isElement() protected méthode

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

isElementOrDocument() protected méthode

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 ///
Résultat bool

iterate() protected méthode

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
Résultat bool

iterateNS() protected méthode

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 ///
Résultat bool

iterateNode() protected méthode

protected iterateNode ( int dp ) : bool
dp int
Résultat bool

iterate_following() protected méthode

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() ///
Résultat bool

iterate_followingNS() protected méthode

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

iterate_following_node() protected méthode

protected iterate_following_node ( ) : bool
Résultat bool

iterate_preceding() protected méthode

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 ///
Résultat bool

iterate_precedingNS() protected méthode

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
Résultat bool

iterate_preceding_node() protected méthode

protected iterate_preceding_node ( int a, int endIndex ) : bool
a int
endIndex int
Résultat bool

loadCurrentNode() protected méthode

protected loadCurrentNode ( ) : void
Résultat void

lookupNS() protected méthode

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
Résultat int

lookupNS() protected méthode

protected lookupNS ( int offset, int len ) : int
offset int
len int
Résultat int

matchElement() public méthode

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 ///
Résultat bool

matchElementNS() public méthode

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 ///
Résultat bool

matchNormalizedTokenString2() protected méthode

protected matchNormalizedTokenString2 ( int index, String s ) : bool
index int
s String
Résultat bool

matchRawTokenString() public méthode

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 ///
Résultat bool

matchRawTokenString2() protected méthode

protected matchRawTokenString2 ( int index, String s ) : bool
index int
s String
Résultat bool

matchTokenString() public méthode

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 ///
Résultat bool

matchTokens() public méthode

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

nodeToElement() protected méthode

protected nodeToElement ( int direction ) : bool
direction int
Résultat bool

overWrite() public méthode

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
Résultat bool

overWrite() public méthode

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
Résultat bool

parseDouble() public méthode

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
Résultat double

parseFloat() public méthode

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
Résultat float

parseInt() public méthode

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 ///
Résultat int

parseInt() protected méthode

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 ///
Résultat int

parseLong() public méthode

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 ///
Résultat long

parseLong() protected méthode

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 ///
Résultat long

pop() public méthode

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
Résultat bool

pop2() protected méthode

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

printL2Buffer() public méthode

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

printLC() public méthode

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

push() public méthode

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
Résultat void

push2() protected méthode

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

recoverNode() public méthode

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
Résultat void

recoverNode_l1() protected méthode

protected recoverNode_l1 ( int index ) : void
index int
Résultat void

recoverNode_l2() protected méthode

protected recoverNode_l2 ( int index ) : void
index int
Résultat void

recoverNode_l3() protected méthode

protected recoverNode_l3 ( int index ) : void
index int
Résultat void

resolveLC() protected méthode

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
Résultat void

resolveLC_l1() protected méthode

protected resolveLC_l1 ( ) : void
Résultat void

resolveLC_l2() protected méthode

protected resolveLC_l2 ( ) : void
Résultat void

resolveLC_l3() protected méthode

protected resolveLC_l3 ( ) : void
Résultat void

sampleState() public méthode

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

startsWith() public méthode

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
Résultat bool

swap_bytes() static public méthode

static public swap_bytes ( int i ) : int
i int
Résultat int

sync() protected méthode

protected sync ( int depth, int index ) : void
depth int
index int
Résultat void

toElement() public méthode

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 ///
Résultat bool

toElement() public méthode

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 ///
Résultat bool

toElementNS() public méthode

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 ///
Résultat bool

toNode() protected méthode

protected toNode ( int dir ) : bool
dir int
Résultat bool

toNode_LastChild() protected méthode

protected toNode_LastChild ( ) : bool
Résultat bool

toNode_PrevSibling() protected méthode

protected toNode_PrevSibling ( ) : bool
Résultat bool

toNormalizedString() public méthode

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 ///
Résultat System.String

toNormalizedString2() public méthode

(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
Résultat String

toNormalizedXPathString() public méthode

public toNormalizedXPathString ( int j ) : String
j int
Résultat String

toRawString() public méthode

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 ///
Résultat System.String

toRawString() public méthode

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
Résultat System.String

toRawString() protected méthode

protected toRawString ( int os, int len, System sb ) : void
os int
len int
sb System
Résultat void

toRawStringLowerCase() public méthode

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
Résultat String

toRawStringLowerCase() protected méthode

protected toRawStringLowerCase ( int os, int len ) : String
os int
len int
Résultat String

toRawStringLowerCase() protected méthode

protected toRawStringLowerCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
Résultat void

toRawStringUpperCase() public méthode

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
Résultat String

toRawStringUpperCase() protected méthode

protected toRawStringUpperCase ( int os, int len ) : String
os int
len int
Résultat String

toRawStringUpperCase() protected méthode

protected toRawStringUpperCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
Résultat void

toString() public méthode

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
Résultat System.String

toString() public méthode

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
Résultat System.String

toString() protected méthode

protected toString ( System sb, int index ) : void
sb System
index int
Résultat void

toString() protected méthode

protected toString ( int os, int len, System sb ) : void
os int
len int
sb System
Résultat void

toStringLowerCase() public méthode

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
Résultat String

toStringLowerCase() protected méthode

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
Résultat String

toStringLowerCase() protected méthode

protected toStringLowerCase ( StringBuilder sb, int index ) : void
sb StringBuilder
index int
Résultat void

toStringLowerCase() protected méthode

protected toStringLowerCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
Résultat void

toStringUpperCase() public méthode

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
Résultat String

toStringUpperCase() protected méthode

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
Résultat String

toStringUpperCase() protected méthode

protected toStringUpperCase ( StringBuilder sb, int index ) : void
sb StringBuilder
index int
Résultat void

toStringUpperCase() protected méthode

protected toStringUpperCase ( int os, int len, StringBuilder sb ) : void
os int
len int
sb StringBuilder
Résultat void

trimWhiteSpaces() public méthode

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
Résultat long

verifyNodeCorrectness() public méthode

public verifyNodeCorrectness ( ) : bool
Résultat bool

writeIndex() public méthode

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

writeSeparateIndex() public méthode

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

writeSeparateIndex() public méthode

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

Property Details

LN protected_oe property

protected int LN
Résultat int

URIName protected_oe property

protected String URIName
Résultat String

XMLDoc protected_oe property

protected IByteBuffer XMLDoc
Résultat IByteBuffer

atTerminal protected_oe property

protected bool atTerminal
Résultat bool

context protected_oe property

protected int[] context
Résultat int[]

contextStack protected_oe property

protected ContextBuffer,com.ximpleware contextStack
Résultat com.ximpleware.ContextBuffer

contextStack2 protected_oe property

protected ContextBuffer,com.ximpleware contextStack2
Résultat com.ximpleware.ContextBuffer

count protected_oe property

protected int count
Résultat int

currentNode protected_oe property

protected BookMark,com.ximpleware currentNode
Résultat com.ximpleware.BookMark

docLen protected_oe property

protected int docLen
Résultat int

docOffset protected_oe property

protected int docOffset
Résultat int

encoding protected_oe property

protected int encoding
Résultat int

fib protected_oe property

protected FastIntBuffer,com.ximpleware fib
Résultat com.ximpleware.FastIntBuffer

l1Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l1Buffer
Résultat com.ximpleware.FastLongBuffer

l1index protected_oe property

protected int l1index
Résultat int

l2Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l2Buffer
Résultat com.ximpleware.FastLongBuffer

l2index protected_oe property

protected int l2index
Résultat int

l2lower protected_oe property

protected int l2lower
Résultat int

l2upper protected_oe property

protected int l2upper
Résultat int

l3Buffer protected_oe property

protected FastIntBuffer,com.ximpleware l3Buffer
Résultat com.ximpleware.FastIntBuffer

l3index protected_oe property

protected int l3index
Résultat int

l3lower protected_oe property

protected int l3lower
Résultat int

l3upper protected_oe property

protected int l3upper
Résultat int

localName protected_oe property

protected String localName
Résultat String

localNameIndex protected_oe property

protected int localNameIndex
Résultat int

maxLCDepthPlusOne protected_oe property

protected short maxLCDepthPlusOne
Résultat short

name protected_oe property

protected String name
Résultat String

nameIndex protected_oe property

protected int nameIndex
Résultat int

nestingLevel protected_oe property

protected int nestingLevel
Résultat int

ns protected_oe property

protected bool ns
Résultat bool

rootIndex protected_oe property

protected int rootIndex
Résultat int

shallowDepth protected_oe property

protected bool shallowDepth
Résultat bool

stackTemp protected_oe property

protected int[] stackTemp
Résultat int[]

vtdBuffer protected_oe property

protected FastLongBuffer vtdBuffer
Résultat FastLongBuffer

vtdSize protected_oe property

protected int vtdSize
Résultat int