public UnionExpr(Expr e1) { e = e1; next = null; current = this; ih = null; state = 0; }
public LocationPathExpr() { state = START; s = null; pathType = RELATIVE_PATH; currentStep = null; //fib = new FastIntBuffer(8);// page size 256 = 2^ 8 ih = new intHash(); }
//public int getPositon(){ // return fib.size_Renamed_Field; //} /// <summary> /// /// </summary> /// <param name="f"></param> /// <param name="l"></param> public PathExpr(Expr f, LocationPathExpr l) { fe = f; lpe = l; //first_time = true; evalState = 0; //fib = new FastIntBuffer(8); ih = new intHash(); }
public override int adjust(int n) { int i = fe.adjust(n); lpe.adjust(n); if (ih != null && i == ih.e) { } else ih = new intHash(i); return i; }
public override int adjust(int n) { int i = fe.adjust(n); lpe.adjust(n); if (ih != null && i == ih.e) { } else { ih = new intHash(i); } return(i); }
/// <summary> /// /// </summary> /// <param name="n"></param> /// <returns></returns> public override int adjust(int n) { int i = e.adjust(n); if (ih != null && i == ih.e) { } else ih = new intHash(i); UnionExpr tmp = this.next; while (tmp != null) { tmp.e.adjust(n); tmp = tmp.next; } return i; }
public override int adjust(int n) { int i = e.adjust(n); if (ih != null && i == ih.e) { } else { ih = new intHash(i); } UnionExpr tmp = this.next; while (tmp != null) { tmp.e.adjust(n); tmp = tmp.next; } return(i); }
/// <summary> /// /// </summary> /// <param name="n"></param> /// <returns></returns> public override int adjust(int n) { int i; if (pathType == RELATIVE_PATH) { i = Math.Min(intHash.determineHashWidth(n), 11); // hash width 64 } else { i = intHash.determineHashWidth(n); } if (ih != null && i <= ih.e) { } else ih = new intHash(i); Step temp = s; while (temp != null) { temp.adjust(n); temp = temp.nextS; } return i; }
/// <summary> /// /// </summary> /// <param name="vn"></param> /// <returns></returns> public override int evalNodeSet(VTDNav vn) { int a; /*if (this.next == null) { return e.evalNodeSet(vn); } else {*/ while (true) { switch (state) { case 0: if (ih == null) ih = new intHash(); if (current != null) { vn.push2(); while ((a = current.e.evalNodeSet(vn)) != -1) { if (isUnique(a)) { state = 1; return a; } } state = 2; vn.pop2(); break; } else state = 3; break; case 1: while ((a = current.e.evalNodeSet(vn)) != -1) { if (isUnique(a)) { state = 1; return a; } } state = 2; vn.pop2(); break; case 2: current = current.next; if (current != null) { vn.push2(); while ((a = current.e.evalNodeSet(vn)) != -1) { if (isUnique(a)) { state = 1; return a; } } vn.pop2(); break; } else state = 3; break; case 3: return -1; default: throw new XPathEvalException("Invalid state evaluating PathExpr"); } } // } /* * default: throw new XPathEvalException( "Invalid state evaluating * PathExpr"); */ }
/* * (non-Javadoc) * * @see com.ximpleware.xpath.Expr#evalNodeSet(com.ximpleware.VTDNav) */ public override int evalNodeSet(VTDNav vn) { int a; if (this.next == null) { return(e.evalNodeSet(vn)); } else { while (true) { switch (state) { case 0: if (ih == null) { ih = new intHash(); } if (current != null) { vn.push2(); while ((a = current.e.evalNodeSet(vn)) != -1) { if (isUnique(a)) { state = 1; return(a); } } state = 2; vn.pop2(); break; } else { state = 3; } break; case 1: while ((a = current.e.evalNodeSet(vn)) != -1) { if (isUnique(a)) { state = 1; return(a); } } state = 2; vn.pop2(); break; case 2: current = current.next; if (current != null) { vn.push2(); while ((a = current.e.evalNodeSet(vn)) != -1) { if (isUnique(a)) { state = 1; return(a); } } vn.pop2(); break; } else { state = 3; } break; case 3: return(-1); default: throw new XPathEvalException("Invalid state evaluating PathExpr"); } } } /* * default: throw new XPathEvalException( "Invalid state evaluating * PathExpr"); */ }
/// <summary> Attach master document to this instance of XMLModifier</summary> /// <param name="masterDocument">* /// </param> public void bind(VTDNav masterDocument) { if (masterDocument == null) throw new System.ArgumentException("MasterDocument can't be null"); md = masterDocument; flb = new FastLongBuffer(); fob = new FastObjectBuffer(); int i = intHash.determineHashWidth(md.vtdSize); insertHash = new intHash(i); deleteHash = new intHash(i); //determine encoding charset string here encoding = md.getEncoding(); switch (encoding) { case VTDNav.FORMAT_ASCII: charSet = "ascii"; break; case VTDNav.FORMAT_ISO_8859_1: charSet = "iso-8859-1"; break; case VTDNav.FORMAT_UTF8: charSet = "utf-8"; break; case VTDNav.FORMAT_UTF_16BE: charSet = "utf-16be"; break; case VTDNav.FORMAT_UTF_16LE: charSet = "utf-16le"; break; case VTDNav.FORMAT_ISO_8859_2: charSet = "iso-8859-2"; break; case VTDNav.FORMAT_ISO_8859_3: charSet = "iso-8859-3"; break; case VTDNav.FORMAT_ISO_8859_4: charSet = "iso-8859-4"; break; case VTDNav.FORMAT_ISO_8859_5: charSet = "iso-8859-5"; break; case VTDNav.FORMAT_ISO_8859_6: charSet = "iso-8859-6"; break; case VTDNav.FORMAT_ISO_8859_7: charSet = "iso-8859-7"; break; case VTDNav.FORMAT_ISO_8859_8: charSet = "iso-8859-8"; break; case VTDNav.FORMAT_ISO_8859_9: charSet = "iso-8859-9"; break; case VTDNav.FORMAT_ISO_8859_10: charSet = "iso-8859-10"; break; case VTDNav.FORMAT_ISO_8859_11: charSet = "iso-8859-11"; break; case VTDNav.FORMAT_ISO_8859_12: charSet = "iso-8859-12"; break; case VTDNav.FORMAT_ISO_8859_13: charSet = "iso-8859-13"; break; case VTDNav.FORMAT_ISO_8859_14: charSet = "iso-8859-14"; break; case VTDNav.FORMAT_ISO_8859_15: charSet = "iso-8859-15"; break; case VTDNav.FORMAT_WIN_1250: charSet = "windows-1250"; break; case VTDNav.FORMAT_WIN_1251: charSet = "windows-1251"; break; case VTDNav.FORMAT_WIN_1252: charSet = "windows-1252"; break; case VTDNav.FORMAT_WIN_1253: charSet = "windows-1253"; break; case VTDNav.FORMAT_WIN_1254: charSet = "windows-1254"; break; case VTDNav.FORMAT_WIN_1255: charSet = "windows-1255"; break; case VTDNav.FORMAT_WIN_1256: charSet = "windows-1256"; break; case VTDNav.FORMAT_WIN_1257: charSet = "windows-1257"; break; case VTDNav.FORMAT_WIN_1258: charSet = "windows-1258"; break; default: throw new ModifyException("Master document encoding not yet supported by XML modifier"); } eg = System.Text.Encoding.GetEncoding(charSet); }
public override int adjust(int n) { int i; if (pathType == RELATIVE_PATH) { i = Math.Min(intHash.determineHashWidth(n), 5); // hash width 64 } else { i = intHash.determineHashWidth(n); } if (ih != null && i == ih.e) { } else ih = new intHash(i); return i; }