/** * Get the token type of the token at the given index value. Creation date: * (11/16/03 6:41:51 PM) * * @return int * @param index * int */ final public int getTokenType(int index) { return (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf; } /**
final protected int getTokenLength2(int index){ return (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_FULL_LEN) >> 32); } /**
/** * Evaluate the namespace indicator in bit 31 and bit 30. Creation date: * (11/27/03 5:38:51 PM) * * @return int * @param i * int */ final private int NSval(int i) { return (int) (vtdBuffer.longAt(i) & MASK_TOKEN_NS_MARK); }
/** * Test the token type, to see if it is a starting tag. * * @return boolean * @param index * int */ protected final boolean isElement(int index) { return (((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf) == TOKEN_STARTING_TAG; }
final protected int getTokenLength2(int index){ return (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_FULL_LEN) >> 32); } /**
/** * Evaluate the namespace indicator in bit 31 and bit 30. Creation date: * (11/27/03 5:38:51 PM) * * @return int * @param i * int */ final private int NSval(int i) { return (int) (vtdBuffer.longAt(i) & MASK_TOKEN_NS_MARK); }
/** * Test the token type, to see if it is a starting tag. * * @return boolean * @param index * int */ protected final boolean isElement(int index) { return (((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf) == TOKEN_STARTING_TAG; }
/** * Get the token type of the token at the given index value. Creation date: * (11/16/03 6:41:51 PM) * * @return int * @param index * int */ final public int getTokenType(int index) { return (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf; } /**
/** * Test the token type, to see if it is a starting tag. * * @return boolean * @param index * int */ protected final boolean isElement(int index) { return (((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf) == TOKEN_STARTING_TAG; }
final protected int getTokenLength2(int index){ return (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_FULL_LEN) >> 32); } /**
/** * Evaluate the namespace indicator in bit 31 and bit 30. Creation date: * (11/27/03 5:38:51 PM) * * @return int * @param i * int */ final private int NSval(int i) { return (int) (vtdBuffer.longAt(i) & MASK_TOKEN_NS_MARK); }
/** * Get the token type of the token at the given index value. Creation date: * (11/16/03 6:41:51 PM) * * @return int * @param index * int */ final public int getTokenType(int index) { return (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf; } /**
/** * Test the token type, to see if it is a starting tag or document token * (introduced in 1.0). * * @return boolean * @param index * int */ protected final boolean isElementOrDocument(int index){ long i =(((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf); return (i==TOKEN_STARTING_TAG||i==TOKEN_DOCUMENT); } /**
/** * Test the token type, to see if it is a starting tag or document token * (introduced in 1.0). * * @return boolean * @param index * int */ protected final boolean isElementOrDocument(int index){ long i =(((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf); return (i==TOKEN_STARTING_TAG||i==TOKEN_DOCUMENT); } /**
/** * Get the depth value of a token (>=0). * * @return int * @param index * int */ final public int getTokenDepth(int index) { int i = (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_DEPTH) >> 52); if (i != 255) return i; return -1; }
/** * Get the depth value of a token (>=0). * * @return int * @param index * int */ final public int getTokenDepth(int index) { int i = (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_DEPTH) >> 52); if (i != 255) return i; return -1; }
/** * Get the depth value of a token (>=0). * * @return int * @param index * int */ final public int getTokenDepth(int index) { int i = (int) ((vtdBuffer.longAt(index) & MASK_TOKEN_DEPTH) >> 52); if (i != 255) return i; return -1; }
/** * Test the token type, to see if it is a starting tag or document token * (introduced in 1.0). * * @return boolean * @param index * int */ protected final boolean isElementOrDocument(int index){ long i =(((vtdBuffer.longAt(index) & MASK_TOKEN_TYPE) >> 60) & 0xf); return (i==TOKEN_STARTING_TAG||i==TOKEN_DOCUMENT); } /**
/** * Get the starting offset (unit in native char) of the token at the given * index. * * @return int * @param index * int */ final public int getTokenOffset(int index) { //return (context[0] != 0) // ? (int) (vtdBuffer.longAt(context[context[0]]) & MASK_TOKEN_OFFSET) // : (int) (vtdBuffer.longAt(rootIndex) & MASK_TOKEN_OFFSET); return (int) (vtdBuffer.longAt(index) & MASK_TOKEN_OFFSET); }
private int increment(int sp){ int type = vn.getTokenType(sp); int vtdSize = vn.vtdBuffer.size; int i=sp+1; while(i<vtdSize && depth == vn.getTokenDepth(i) && type == vn.getTokenType(i)&& (vn.getTokenOffset(i-1)+ (int)((vn.vtdBuffer.longAt(i-1) & VTDNav.MASK_TOKEN_FULL_LEN)>>32) == vn.getTokenOffset(i)) ){ i++; } return i; }