|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ximpleware.extended.VTDNavHuge
public class VTDNavHuge
VTDNavHuge is a cursor-based VTD record navigator supporting extended VTD (256 GB max file size). The core navigation routines are toElement() and toElementNS() push() and pop() allows one to save and restore the location of the cursor String comparsions and primitive data type conversions are done directly from VTD records without intermediatary string creation.
Method Summary | |
---|---|
int |
compareRawTokenString(int index,
java.lang.String s)
New in 2.0 Compare the string against the token at the given index value. |
int |
compareTokens(int i1,
VTDNavHuge vn2,
int i2)
This method compares two VTD tokens of VTDNav objects The behavior of this method is like compare the strings corresponds to i1 and i2, meaning for text or attribute val, entities will be converted into the corresponding char |
int |
compareTokenString(int index,
java.lang.String s)
New in 2.0 Compare the string against the token at the given index value. |
boolean |
contains(int index,
java.lang.String s)
Test whether a given token contains s. |
boolean |
endsWith(int index,
java.lang.String s)
Test the end of token content at index i matches the content of s, notice that this is to save the string allocation cost of using String's built-in endsWidth |
int |
getAttrCount()
Return the attribute count of the element at the cursor position. |
int |
getAttrVal(java.lang.String an)
Get the token index of the attribute value given an attribute name. |
int |
getAttrValNS(java.lang.String URL,
java.lang.String ln)
Get the token index of the attribute value of given URL and local name. |
int |
getCurrentDepth()
Get the depth (>=0) of the current element. |
int |
getCurrentIndex()
Get the index value of the current element. |
int |
getEncoding()
Get the encoding of the XML document. |
int |
getNestingLevel()
Get the maximum nesting depth of the XML document (>0). |
long |
getOffsetAfterHead()
|
int |
getRawStringLength(int index)
|
int |
getRootIndex()
Get root index value , which is the index val of document element |
int |
getStringLength(int index)
|
int |
getText()
This method returns of the token index of the type character data or CDATA. |
int |
getTokenCount()
Get total number of VTD tokens for the current XML document. |
int |
getTokenDepth(int index)
Get the depth value of a token (>=0). |
int |
getTokenLength(int index)
Get the token length at the given index value please refer to VTD spec for more details Length is in terms of the UTF char unit For prefixed tokens, it is the qualified name length. |
long |
getTokenOffset(int index)
Get the starting offset of the token at the given index. |
int |
getTokenType(int index)
Get the token type of the token at the given index value. |
com.ximpleware.extended.IByteBuffer |
getXML()
Get the XML document |
boolean |
hasAttr(java.lang.String an)
Test whether current element has an attribute with the matching name. |
boolean |
hasAttrNS(java.lang.String URL,
java.lang.String ln)
Test whether the current element has an attribute with matching namespace URL and localname. |
boolean |
matchElement(java.lang.String en)
Test if the current element matches the given name. |
boolean |
matchElementNS(java.lang.String URL,
java.lang.String ln)
Test whether the current element matches the given namespace URL and localname. |
boolean |
matchRawTokenString(int index,
java.lang.String s)
Match the string against the token at the given index value. |
boolean |
matchTokens(int i1,
VTDNavHuge vn2,
int i2)
This method matches two VTD tokens of VTDNav objects |
boolean |
matchTokenString(int index,
java.lang.String s)
Match the string against the token at the given index value. |
double |
parseDouble(int index)
Convert a vtd token into a double. |
float |
parseFloat(int index)
Convert a vtd token into a float. |
int |
parseInt(int index)
Convert a vtd token into an int. |
long |
parseLong(int index)
Convert a vtd token into a long. |
boolean |
pop()
Load the context info from ContextBuffer. |
void |
push()
Store the context info into the ContextBuffer. |
void |
sampleState(com.ximpleware.extended.FastIntBuffer fib)
This is for debugging purpose |
boolean |
startsWith(int index,
java.lang.String s)
Test the start of token content at index i matches the content of s, notice that this is to save the string allocation cost of using String's built-in startsWidth |
boolean |
toElement(int direction)
A generic navigation method. |
boolean |
toElement(int direction,
java.lang.String en)
A generic navigation method. |
boolean |
toElementNS(int direction,
java.lang.String URL,
java.lang.String ln)
A generic navigation method with namespace support. |
java.lang.String |
toNormalizedString(int index)
This method normalizes a token into a string in a way that resembles DOM. |
java.lang.String |
toRawString(int index)
Convert a token at the given index to a String, (built-in entity and char references not resolved) (entities and char references not expanded). |
java.lang.String |
toRawStringLowerCase(int index)
|
java.lang.String |
toRawStringUpperCase(int index)
|
java.lang.String |
toString(int index)
Convert a token at the given index to a String, (entities and char references resolved). |
java.lang.String |
toStringLowerCase(int index)
Convert a token at the given index to a String and any upper case character will be converted to lower case, (entities and char references resolved). |
java.lang.String |
toStringUpperCase(int index)
Convert a token at the given index to a String and any lower case character will be converted to upper case, (entities and char references resolved). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FC
public static final int FIRST_CHILD
public static final int FORMAT_ASCII
public static final int FORMAT_ISO_8859_1
public static final int FORMAT_ISO_8859_10
public static final int FORMAT_ISO_8859_11
public static final int FORMAT_ISO_8859_12
public static final int FORMAT_ISO_8859_13
public static final int FORMAT_ISO_8859_14
public static final int FORMAT_ISO_8859_15
public static final int FORMAT_ISO_8859_16
public static final int FORMAT_ISO_8859_2
public static final int FORMAT_ISO_8859_3
public static final int FORMAT_ISO_8859_4
public static final int FORMAT_ISO_8859_5
public static final int FORMAT_ISO_8859_6
public static final int FORMAT_ISO_8859_7
public static final int FORMAT_ISO_8859_8
public static final int FORMAT_ISO_8859_9
public static final int FORMAT_UTF_16BE
public static final int FORMAT_UTF_16LE
public static final int FORMAT_UTF8
public static final int FORMAT_WIN_1250
public static final int FORMAT_WIN_1251
public static final int FORMAT_WIN_1252
public static final int FORMAT_WIN_1253
public static final int FORMAT_WIN_1254
public static final int FORMAT_WIN_1255
public static final int FORMAT_WIN_1256
public static final int FORMAT_WIN_1257
public static final int FORMAT_WIN_1258
public static final int LAST_CHILD
public static final int LC
public static final int NEXT_SIBLING
public static final int NS
public static final int P
public static final int PARENT
public static final int PREV_SIBLING
public static final int PS
public static final int R
public static final int ROOT
public static final int TOKEN_ATTR_NAME
public static final int TOKEN_ATTR_NS
public static final int TOKEN_ATTR_VAL
public static final int TOKEN_CDATA_VAL
public static final int TOKEN_CHARACTER_DATA
public static final int TOKEN_COMMENT
public static final int TOKEN_DEC_ATTR_NAME
public static final int TOKEN_DEC_ATTR_VAL
public static final int TOKEN_DOCUMENT
public static final int TOKEN_DTD_VAL
public static final int TOKEN_ENDING_TAG
public static final int TOKEN_PI_NAME
public static final int TOKEN_PI_VAL
public static final int TOKEN_STARTING_TAG
Method Detail |
---|
public final int compareRawTokenString(int index, java.lang.String s) throws NavExceptionHuge
index
- s
-
NavExceptionHuge
public int compareTokens(int i1, VTDNavHuge vn2, int i2) throws NavExceptionHuge
i1
- vn2
- i2
-
NavExceptionHuge
public int compareTokenString(int index, java.lang.String s) throws NavExceptionHuge
index
- s
-
NavExceptionHuge
public final boolean contains(int index, java.lang.String s) throws NavExceptionHuge
index
- s
-
NavExceptionHuge
public final boolean endsWith(int index, java.lang.String s) throws NavExceptionHuge
i
-
NavExceptionHuge
public int getAttrCount()
public int getAttrVal(java.lang.String an) throws NavExceptionHuge
an
- java.lang.String
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD etc can be generated by another
machine from a load-balancer.
IllegalArguementException
- if an is nullpublic int getAttrValNS(java.lang.String URL, java.lang.String ln) throws NavExceptionHuge
URL
- java.lang.String (Name space URL)ln
- java.lang.String (local name)
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD etc can be generated by another
machine from a load-balancer.
IllegalArguementException
- if s is nullpublic final int getCurrentDepth()
public final int getCurrentIndex()
public final int getEncoding()
public final int getNestingLevel()
public final long getOffsetAfterHead()
public final int getRawStringLength(int index) throws NavExceptionHuge
NavExceptionHuge
public final int getRootIndex()
public final int getStringLength(int index) throws NavExceptionHuge
NavExceptionHuge
public int getText()
public final int getTokenCount()
public final int getTokenDepth(int index)
index
- int
public int getTokenLength(int index)
index
- int
public final long getTokenOffset(int index)
index
- int
public final int getTokenType(int index)
index
- int
public final com.ximpleware.extended.IByteBuffer getXML()
public final boolean hasAttr(java.lang.String an) throws NavExceptionHuge
an
- java.lang.String
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD etc can be generated by another
machine from a load-balancer.
IllegalArguementException
- if an is nullpublic final boolean hasAttrNS(java.lang.String URL, java.lang.String ln) throws NavExceptionHuge
URL
- java.lang.String (namespace URL)ln
- java.lang.String (localname )
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD can be generated by another
machine such as a load-balancer.
IllegalArguementException
- if ln is nullpublic final boolean matchElement(java.lang.String en) throws NavExceptionHuge
en
- java.lang.String
NavExceptionHuge
- If the underlying raw char representation has errors.public boolean matchElementNS(java.lang.String URL, java.lang.String ln) throws NavExceptionHuge
URL
- java.lang.Stringln
- java.lang.String
NavExceptionHuge
- When there is any encoding conversion error or unknown entity.
java.lang.IllegalArgumentException
- if ln == nullpublic final boolean matchRawTokenString(int index, java.lang.String s) throws NavExceptionHuge
index
- int (index into the VTD token buffer)s
- java.lang.String
NavExceptionHuge
- When if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD can be generated by another
machine such as a load-balancer.public final boolean matchTokens(int i1, VTDNavHuge vn2, int i2) throws NavExceptionHuge
i1
- vn2
- i2
-
NavExceptionHuge
public final boolean matchTokenString(int index, java.lang.String s) throws NavExceptionHuge
index
- ints
- java.lang.String
NavExceptionHuge
- 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 double parseDouble(int index) throws NavExceptionHuge
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD can be generated by another
machine such as a load-balancer.public float parseFloat(int index) throws NavExceptionHuge
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD can be generated by another
machine such as a load-balancer.public int parseInt(int index) throws NavExceptionHuge
index
- int
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD can be generated by another
machine such as a load-balancer.public long parseLong(int index) throws NavExceptionHuge
index
- int
NavExceptionHuge
- The exception if the underlying byte
content contains various errors. Notice that we are being conservative in making little assumption on
the correctness of underlying byte content. This is because the VTD can be generated by another
machine such as a load-balancer.public final boolean pop()
public final void push()
public void sampleState(com.ximpleware.extended.FastIntBuffer fib)
fib
- public final boolean startsWith(int index, java.lang.String s) throws NavExceptionHuge
index
- s
-
NavExceptionHuge
public boolean toElement(int direction) throws NavExceptionHuge
ROOT 0
PARENT 1
FIRST_CHILD 2
LAST_CHILD 3
NEXT_SIBLING 4
PREV_SIBLING 5
direction
- int
NavExceptionHuge
- When direction value is illegal.public boolean toElement(int direction, java.lang.String en) throws NavExceptionHuge
ROOT 0
PARENT 1
FIRST_CHILD 2
LAST_CHILD 3
NEXT_SIBLING 4
PREV_SIBLING 5
direction
- inten
- String
NavExceptionHuge
- When direction value is illegal. Or there are errors
in underlying byte representation of the document
IllegalArguementException
- if en is nullpublic boolean toElementNS(int direction, java.lang.String URL, java.lang.String ln) throws NavExceptionHuge
ROOT 0
PARENT 1
FIRST_CHILD 2
LAST_CHILD 3
NEXT_SIBLING 4
PREV_SIBLING 5
direction
- intURL
- Stringln
- String
NavExceptionHuge
- When direction value is illegal. Or there are errors
in underlying byte representation of the documentpublic java.lang.String toNormalizedString(int index) throws NavExceptionHuge
index
- int
NavExceptionHuge
- When the encoding has errorspublic java.lang.String toRawString(int index) throws NavExceptionHuge
index
- int
NavExceptionHuge
- When the encoding has errorspublic final java.lang.String toRawStringLowerCase(int index) throws NavExceptionHuge
NavExceptionHuge
public final java.lang.String toRawStringUpperCase(int index) throws NavExceptionHuge
index
-
NavException
NavExceptionHuge
public java.lang.String toString(int index) throws NavExceptionHuge
index
-
NavExceptionHuge
public java.lang.String toStringLowerCase(int index) throws NavExceptionHuge
index
-
NavExceptionHuge
public java.lang.String toStringUpperCase(int index) throws NavExceptionHuge
index
-
NavExceptionHuge
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |