/** * * This function will do the range checking and make * sure there is no overlapping or invalid deletion * There can be only one deletion at one offset value * Delete can't overlap with, nor contains, another delete * */ protected void check() throws ModifyException{ int os1, os2, temp; int size = flb.size; for (int i=0;i<size;i++){ os1 = flb.lower32At(i); os2 = flb.lower32At(i)+ (flb.upper32At(i)& 0x1fffffff)-1; if (i+1<size){ temp = flb.lower32At(i+1); if (temp!= os1 && temp<=os2) throw new ModifyException ("Invalid insertion/deletion condition detected between offset " +os1 + " and offset "+os2); } } }
/** * * This function will do the range checking and make * sure there is no overlapping or invalid deletion * There can be only one deletion at one offset value * Delete can't overlap with, nor contains, another delete * */ protected void check() throws ModifyException{ int os1, os2, temp; int size = flb.size; for (int i=0;i<size;i++){ os1 = flb.lower32At(i); os2 = flb.lower32At(i)+ (flb.upper32At(i)& 0x1fffffff)-1; if (i+1<size){ temp = flb.lower32At(i+1); if (temp!= os1 && temp<=os2) throw new ModifyException ("Invalid insertion/deletion condition detected between offset " +os1 + " and offset "+os2); } } }
/** * * This function will do the range checking and make * sure there is no overlapping or invalid deletion * There can be only one deletion at one offset value * Delete can't overlap with, nor contains, another delete * */ protected void check() throws ModifyException{ int os1, os2, temp; int size = flb.size; for (int i=0;i<size;i++){ os1 = flb.lower32At(i); os2 = flb.lower32At(i)+ (flb.upper32At(i)& 0x1fffffff)-1; if (i+1<size){ temp = flb.lower32At(i+1); if (temp!= os1 && temp<=os2) throw new ModifyException ("Invalid insertion/deletion condition detected between offset " +os1 + " and offset "+os2); } } }
int size = flb.size; for (int i=0;i<size;){ os1 = flb.lower32At(i); os2 = flb.lower32At(i)+ (flb.upper32At(i)& 0x1fffffff)-1; temp = flb.lower32At(i+z); if (temp==os1){ if ((flb.upper32At(i+z)& 0x1fffffff)!=0) // not an insert os2=flb.lower32At(i+z)+ (flb.upper32At(i+z)& 0x1fffffff)-1; z++; int k= flb.lower32At(i+z)+ (flb.upper32At(i+z)& 0x1fffffff)-1; if (k>os2)
int size = flb.size; for (int i=0;i<size;){ os1 = flb.lower32At(i); os2 = flb.lower32At(i)+ (flb.upper32At(i)& 0x1fffffff)-1; temp = flb.lower32At(i+z); if (temp==os1){ if ((flb.upper32At(i+z)& 0x1fffffff)!=0) // not an insert os2=flb.lower32At(i+z)+ (flb.upper32At(i+z)& 0x1fffffff)-1; z++; int k= flb.lower32At(i+z)+ (flb.upper32At(i+z)& 0x1fffffff)-1; if (k>os2)
private final void recoverNode_l5(int index){ //l3 int i = l4Buffer.lower32At(l4index); if (l5lower != i) { //l3lower and l3upper are always together l5lower = i; // l3lower shouldn't be -1 //l3index = l3lower; l5upper = l5Buffer.size - 1; for (int k = l4index + 1; k < l4Buffer.size; k++) { i = l4Buffer.lower32At(k); if (i != 0xffffffff) { l5upper = i - 1; break; } } } int t1=l5Buffer.intAt(l5lower); int t2=l5Buffer.intAt(l5upper); i= Math.min(l5lower+ (int)(((float)(index-t1)/(t2-t1+1))*(l5upper-l5lower)),l5upper) ; while(i<l5Buffer.size-1 && l5Buffer.intAt(i)<index){ i++; } while (l5Buffer.intAt(i)>index && i>0) i--; //System.out.println(" i ===> "+i); context[5] = l5Buffer.intAt(i); l5index = i; }
private final void recoverNode_l3(int index){ int i = l2Buffer.lower32At(l2index); if (l3lower != i) { //l3lower and l3upper are always together l3lower = i; // l3lower shouldn't be -1 //l3index = l3lower; l3upper = l3Buffer.size - 1; for (int k = l2index + 1; k < l2Buffer.size; k++) { i = l2Buffer.lower32At(k); if (i != 0xffffffff) { l3upper = i - 1; break; } } } int t1=l3Buffer.intAt(l3lower); int t2=l3Buffer.intAt(l3upper); i= Math.min(l3lower+ (int)(((float)(index-t1)/(t2-t1+1))*(l3upper-l3lower)),l3upper) ; while(i<l3Buffer.size-1 && l3Buffer.intAt(i)<index){ i++; } while (l3Buffer.intAt(i)>index && i>0) i--; //System.out.println(" i ===> "+i); context[3] = l3Buffer.intAt(i); l3index = i; }
private final void recoverNode_l3(int index){ int i = l2Buffer.lower32At(l2index); if (l3lower != i) { //l3lower and l3upper are always together l3lower = i; // l3lower shouldn't be -1 //l3index = l3lower; l3upper = l3Buffer.size - 1; for (int k = l2index + 1; k < l2Buffer.size; k++) { i = l2Buffer.lower32At(k); if (i != 0xffffffff) { l3upper = i - 1; break; } } } int t1=l3Buffer.intAt(l3lower); int t2=l3Buffer.intAt(l3upper); i= Math.min(l3lower+ (int)(((float)(index-t1)/(t2-t1+1))*(l3upper-l3lower)),l3upper) ; while(i<l3Buffer.size-1 && l3Buffer.intAt(i)<index){ i++; } while (l3Buffer.intAt(i)>index && i>0) i--; //System.out.println(" i ===> "+i); context[3] = l3Buffer.intAt(i); l3index = i; }
private final void recoverNode_l5(int index){ //l3 int i = l4Buffer.lower32At(l4index); if (l5lower != i) { //l3lower and l3upper are always together l5lower = i; // l3lower shouldn't be -1 //l3index = l3lower; l5upper = l5Buffer.size - 1; for (int k = l4index + 1; k < l4Buffer.size; k++) { i = l4Buffer.lower32At(k); if (i != 0xffffffff) { l5upper = i - 1; break; } } } int t1=l5Buffer.intAt(l5lower); int t2=l5Buffer.intAt(l5upper); i= Math.min(l5lower+ (int)(((float)(index-t1)/(t2-t1+1))*(l5upper-l5lower)),l5upper) ; while(i<l5Buffer.size-1 && l5Buffer.intAt(i)<index){ i++; } while (l5Buffer.intAt(i)>index && i>0) i--; //System.out.println(" i ===> "+i); context[5] = l5Buffer.intAt(i); l5index = i; }
private final void recoverNode_l5(int index){ //l3 int i = l4Buffer.lower32At(l4index); if (l5lower != i) { //l3lower and l3upper are always together l5lower = i; // l3lower shouldn't be -1 //l3index = l3lower; l5upper = l5Buffer.size - 1; for (int k = l4index + 1; k < l4Buffer.size; k++) { i = l4Buffer.lower32At(k); if (i != 0xffffffff) { l5upper = i - 1; break; } } } int t1=l5Buffer.intAt(l5lower); int t2=l5Buffer.intAt(l5upper); i= Math.min(l5lower+ (int)(((float)(index-t1)/(t2-t1+1))*(l5upper-l5lower)),l5upper) ; while(i<l5Buffer.size-1 && l5Buffer.intAt(i)<index){ i++; } while (l5Buffer.intAt(i)>index && i>0) i--; //System.out.println(" i ===> "+i); context[5] = l5Buffer.intAt(i); l5index = i; }
private final void recoverNode_l3(int index){ int i = l2Buffer.lower32At(l2index); if (l3lower != i) { //l3lower and l3upper are always together l3lower = i; // l3lower shouldn't be -1 //l3index = l3lower; l3upper = l3Buffer.size - 1; for (int k = l2index + 1; k < l2Buffer.size; k++) { i = l2Buffer.lower32At(k); if (i != 0xffffffff) { l3upper = i - 1; break; } } } int t1=l3Buffer.intAt(l3lower); int t2=l3Buffer.intAt(l3upper); i= Math.min(l3lower+ (int)(((float)(index-t1)/(t2-t1+1))*(l3upper-l3lower)),l3upper) ; while(i<l3Buffer.size-1 && l3Buffer.intAt(i)<index){ i++; } while (l3Buffer.intAt(i)>index && i>0) i--; //System.out.println(" i ===> "+i); context[3] = l3Buffer.intAt(i); l3index = i; }