/** * This method will insert a namespace compensated fragment before the tail of cursor element, * @param ef * @throws ModifyException * @throws NavException */ public void insertBeforeTail(ElementFragmentNs ef) throws ModifyException, NavException{ long i = md.getOffsetBeforeTail(); if (i<0){ //throw new ModifyException("Insertion failed"); insertAfterHead(ef); return; } insertElementFragmentNsAt((int)i, ef); }
/** * This method will insert a namespace compensated fragment before the tail of cursor element, * @param ef * @throws ModifyException * @throws NavException */ public void insertBeforeTail(ElementFragmentNs ef) throws ModifyException, NavException{ long i = md.getOffsetBeforeTail(); if (i<0){ //throw new ModifyException("Insertion failed"); insertAfterHead(ef); return; } insertElementFragmentNsAt((int)i, ef); }
/** * This method will insert a namespace compensated fragment before the tail of cursor element, * @param ef * @throws ModifyException * @throws NavException */ public void insertBeforeTail(ElementFragmentNs ef) throws ModifyException, NavException{ long i = md.getOffsetBeforeTail(); if (i<0){ //throw new ModifyException("Insertion failed"); insertAfterHead(ef); return; } insertElementFragmentNsAt((int)i, ef); }
/** * Insert a namespace compensated fragment before the cursor element * @param ef * @throws ModifyException * * */ public void insertBeforeElement(ElementFragmentNs ef) throws ModifyException{ int startTagIndex =md.getCurrentIndex(); int type = md.getTokenType(startTagIndex); if (type!=VTDNav.TOKEN_STARTING_TAG) throw new ModifyException("Token type is not a starting tag"); int offset = md.getTokenOffset(startTagIndex)-1; if (encoding < VTDNav.FORMAT_UTF_16BE) insertElementFragmentNsAt(offset,ef); else insertElementFragmentNsAt((offset)<<1,ef); }
/** * Insert a namespace compensated fragment before the cursor element * @param ef * @throws ModifyException * * */ public void insertBeforeElement(ElementFragmentNs ef) throws ModifyException{ int startTagIndex =md.getCurrentIndex(); int type = md.getTokenType(startTagIndex); if (type!=VTDNav.TOKEN_STARTING_TAG) throw new ModifyException("Token type is not a starting tag"); int offset = md.getTokenOffset(startTagIndex)-1; if (encoding < VTDNav.FORMAT_UTF_16BE) insertElementFragmentNsAt(offset,ef); else insertElementFragmentNsAt((offset)<<1,ef); }
/** * Insert a namespace compensated fragment before the cursor element * @param ef * @throws ModifyException * * */ public void insertBeforeElement(ElementFragmentNs ef) throws ModifyException{ int startTagIndex =md.getCurrentIndex(); int type = md.getTokenType(startTagIndex); if (type!=VTDNav.TOKEN_STARTING_TAG) throw new ModifyException("Token type is not a starting tag"); int offset = md.getTokenOffset(startTagIndex)-1; if (encoding < VTDNav.FORMAT_UTF_16BE) insertElementFragmentNsAt(offset,ef); else insertElementFragmentNsAt((offset)<<1,ef); }
/** * This method will insert an ElementFragmentNs instance * after the head of cursor element, * @param efn * @throws ModifyException * @throws NavException * */ public void insertAfterHead(ElementFragmentNs ef) throws ModifyException, NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertElementFragmentNsEnclosedAt((int)i-1, ef); insertEndingTag(i); return; } insertElementFragmentNsAt((int)i, ef); }
/** * This method will insert an ElementFragmentNs instance * after the head of cursor element, * @param ef * @throws ModifyException * @throws NavException * */ public void insertAfterHead(ElementFragmentNs ef) throws ModifyException, NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertElementFragmentNsEnclosedAt((int)i-1, ef); insertEndingTag(i); return; } insertElementFragmentNsAt((int)i, ef); }
/** * This method will insert an ElementFragmentNs instance * after the head of cursor element, * @param efn * @throws ModifyException * @throws NavException * */ public void insertAfterHead(ElementFragmentNs ef) throws ModifyException, NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertElementFragmentNsEnclosedAt((int)i-1, ef); insertEndingTag(i); return; } insertElementFragmentNsAt((int)i, ef); }
/** * Insert a namespace compensated element after cursor element * @param ef (an ElementFragmentNs object) * @throws ModifyException * @throws NavException * */ public void insertAfterElement(ElementFragmentNs ef) throws ModifyException, NavException { int startTagIndex = md.getCurrentIndex(); int type = md.getTokenType(startTagIndex); if (type != VTDNav.TOKEN_STARTING_TAG) throw new ModifyException("Token type is not a starting tag"); long l = md.getElementFragment(); int offset = (int) l; int len = (int) (l >> 32); insertElementFragmentNsAt(offset + len, ef); }
/** * Insert a namespace compensated element after cursor element * @param ef (an ElementFragmentNs object) * @throws ModifyException * @throws NavException * */ public void insertAfterElement(ElementFragmentNs ef) throws ModifyException, NavException { int startTagIndex = md.getCurrentIndex(); int type = md.getTokenType(startTagIndex); if (type != VTDNav.TOKEN_STARTING_TAG) throw new ModifyException("Token type is not a starting tag"); long l = md.getElementFragment(); int offset = (int) l; int len = (int) (l >> 32); insertElementFragmentNsAt(offset + len, ef); }
/** * Insert a namespace compensated element after cursor element * @param ef (an ElementFragmentNs object) * @throws ModifyException * @throws NavException * */ public void insertAfterElement(ElementFragmentNs ef) throws ModifyException, NavException { int startTagIndex = md.getCurrentIndex(); int type = md.getTokenType(startTagIndex); if (type != VTDNav.TOKEN_STARTING_TAG) throw new ModifyException("Token type is not a starting tag"); long l = md.getElementFragment(); int offset = (int) l; int len = (int) (l >> 32); insertElementFragmentNsAt(offset + len, ef); }