/** * This method will insert s' byte array representation * of the string after the head of cursor element, * @param s * @throws ModifyException * @throws UnsupportedEncodingException * @throws NavException * */ public void insertAfterHead(String s) throws ModifyException, UnsupportedEncodingException, NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,s.getBytes(charSet)); insertEndingTag(i); return; } insertBytesAt((int)i,s.getBytes(charSet)); }
/** * This method will insert s' byte array representation * of the string after the head of cursor element, * @param s * @return * @throws ModifyException * @throws NavException * @throws TranscodeException * */ public void insertAfterHead(String s) throws ModifyException, UnsupportedEncodingException, NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,s.getBytes(charSet)); insertEndingTag(i); return; } insertBytesAt((int)i,s.getBytes(charSet)); }
/** * This method will insert s' byte array representation * of the string after the head of cursor element, * @param s * @return * @throws ModifyException * @throws NavException * @throws TranscodeException * */ public void insertAfterHead(String s) throws ModifyException, UnsupportedEncodingException, NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,s.getBytes(charSet)); insertEndingTag(i); return; } insertBytesAt((int)i,s.getBytes(charSet)); }
/** * 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); }
/** * This method will insert a segment of the byte array b after the head of cursor element * @param b * @param l * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b, long l) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,b, (int)l,(int)(l<<32)); insertEndingTag(i); return; } insertBytesAt((int)i,b,l); }
/** * This method will insert a segment of the byte array b after the head of cursor element * @param b * @param l * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b, long l) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,b, (int)l,(int)(l<<32)); insertEndingTag(i); return; } insertBytesAt((int)i,b,l); }
/** * This method will insert a segment of the byte array b after the head of cursor element, * @param b * @param offset * @param len * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b, int offset, int len) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,b, offset,len ); insertEndingTag(i); return; } insertBytesAt((int)i,b,offset, len); }
/** * This method will insert a segment of the byte array b after the head of cursor element, * @param b * @param offset * @param len * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b, int offset, int len) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,b, offset,len ); insertEndingTag(i); return; } insertBytesAt((int)i,b,offset, len); }
/** * 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 a segment of the byte array b after the head of cursor element * @param b * @param l * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b, long l) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,b, (int)l,(int)(l<<32)); insertEndingTag(i); return; } insertBytesAt((int)i,b,l); }
/** * This method will insert byte array b after the head of cursor element, * @param b * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); // handle empty element case // <a/> would become <a>b's content</a> // so there are two insertions there insertBytesEnclosedAt((int)i-1,b); insertEndingTag(i); return; } insertBytesAt((int)i,b); } /**
/** * This method will insert a segment of the byte array b after the head of cursor element, * @param b * @param offset * @param len * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b, int offset, int len) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); insertBytesEnclosedAt((int)i-1,b, offset,len ); insertEndingTag(i); return; } insertBytesAt((int)i,b,offset, len); }
/** * This method will insert byte array b after the head of cursor element, * @param b * @return * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); // handle empty element case // <a/> would become <a>b's content</a> // so there are two insertions there insertBytesEnclosedAt((int)i-1,b); insertEndingTag(i); return; } insertBytesAt((int)i,b); } /**
/** * This method will insert byte array b after the head of cursor element, * @param b * @return * @throws ModifyException * @throws NavException * */ public void insertAfterHead(byte[] b) throws ModifyException,NavException{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); // handle empty element case // <a/> would become <a>b's content</a> // so there are two insertions there insertBytesEnclosedAt((int)i-1,b); insertEndingTag(i); return; } insertBytesAt((int)i,b); } /**
/** * This method will insert the transcoded representation of * byte array b after the head of cursor element, * @param src_encoding * @param b * @exception ModifyException * @exception NavException * @exception TranscodeException * */ public void insertAfterHead(int src_encoding, byte[] b) throws ModifyException, NavException,TranscodeException { if(src_encoding == encoding){ insertAfterHead(b); }else{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); byte[] bo = Transcoder.transcode(b, 0, b.length, src_encoding, encoding); insertBytesEnclosedAt((int)i-1,bo); insertEndingTag(i); return; } byte[] bo = Transcoder.transcode(b, 0, b.length, src_encoding, encoding); insertBytesAt((int)i,bo); } } /**
/** * This method will insert the transcoded representation of * a segment of the byte array b after the head of cursor element, * @param src_encoding * @param b * @param l * @return * @throws ModifyException * @throws NavException * @throws TranscodeException * */ public void insertAfterHead(int src_encoding, byte[] b, long l) throws ModifyException, NavException,TranscodeException { if(src_encoding == encoding){ insertAfterHead(b,l); }else{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); byte[] bo = Transcoder.transcode(b, (int)l, (int)l>>32, src_encoding, encoding); insertBytesEnclosedAt((int)i-1,bo,l); insertEndingTag(i); return; } byte[] bo = Transcoder.transcode(b, (int)l, (int)l>>32, src_encoding, encoding); insertBytesAt((int)i,bo,l); } }
/** * This method will insert the transcoded representation of * a segment of the byte array b after the head of cursor element, * @param src_encoding * @param b * @param l * @throws ModifyException * @throws NavException * @throws TranscodeException * */ public void insertAfterHead(int src_encoding, byte[] b, long l) throws ModifyException, NavException,TranscodeException { if(src_encoding == encoding){ insertAfterHead(b,l); }else{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); byte[] bo = Transcoder.transcode(b, (int)l, (int)l>>32, src_encoding, encoding); insertBytesEnclosedAt((int)i-1,bo,l); insertEndingTag(i); return; } byte[] bo = Transcoder.transcode(b, (int)l, (int)l>>32, src_encoding, encoding); insertBytesAt((int)i,bo,l); } }
/** * This method will insert the transcoded representation of * byte array b after the head of cursor element, * @param src_encoding * @param b * @return * @throws ModifyException * @throws NavException * @throws TranscodeException * */ public void insertAfterHead(int src_encoding, byte[] b) throws ModifyException, NavException,TranscodeException { if(src_encoding == encoding){ insertAfterHead(b); }else{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); byte[] bo = Transcoder.transcode(b, 0, b.length, src_encoding, encoding); insertBytesEnclosedAt((int)i-1,bo); insertEndingTag(i); return; } byte[] bo = Transcoder.transcode(b, 0, b.length, src_encoding, encoding); insertBytesAt((int)i,bo); } } /**
/** * This method will insert the transcoded representation of * a segment of the byte array b after the head of cursor element, * @param src_encoding * @param b * @param offset * @param length * @throws ModifyException * @throws NavException * @throws TranscodeException * */ public void insertAfterHead(int src_encoding, byte[] b, int offset, int length) throws ModifyException, NavException,TranscodeException { if(src_encoding == encoding){ insertAfterHead(b,offset,length); }else{ long i = md.getOffsetAfterHead(); if (i<0){ //throw new ModifyException("Insertion failed"); byte[] bo = Transcoder.transcode(b, offset, length, src_encoding, encoding); insertBytesEnclosedAt((int)i-1,bo); insertEndingTag(i); return; } byte[] bo = Transcoder.transcode(b, offset, length, src_encoding, encoding); insertBytesAt((int)i,bo,offset, length); } } /**