private static int findReg(char[] data, int off, int regOff, int regLen, Term term, int out) { if (off >= out) return -1; int i = off; if (term.type == Term.REG || term.type == Term.REG_I) { while (i < out) { if (compareRegions(data, i, regOff, regLen, out, term)) break; i++; } } else throw new IllegalArgumentException("wrong findReg() target:" + term.type); return off - i; }
private static int findReg(char[] data, int off, int regOff, int regLen, Term term, int out) { if (off >= out) return -1; int i = off; if (term.type == Term.REG || term.type == Term.REG_I) { while (i < out) { if (compareRegions(data, i, regOff, regLen, out, term)) break; i++; } } else throw new IllegalArgumentException("wrong findReg() target:" + term.type); return off - i; }
private static int findBackReg(char[] data, int off, int regOff, int regLen, int maxCount, Term term, int out) { //assume that the cases when regLen==0 or maxCount==0 are handled by caller int i = off; int iMin = off - maxCount; if (term.type == Term.REG || term.type == Term.REG_I) { /*@since 1.2*/ char first = data[regOff]; regOff++; regLen--; for (; ; ) { i--; if (data[i] == first && compareRegions(data, i + 1, regOff, regLen, out, term)) break; if (i <= iMin) return -1; } }/* else if (term.type == Term.REG_I) { char c, firstChar = Category.caseFold(data[regOff]); regOff++; regLen--; for (; ; ) { i--; if (((c = Category.caseFold(data[i])) == firstChar) && compareRegionsI(data, i + 1, regOff, regLen, out)) break; if (i <= iMin) return -1; } return off - i; }*/ else throw new IllegalArgumentException("wrong findBackReg() target type :" + term.type); return off - i; }
private static int findBackReg(char[] data, int off, int regOff, int regLen, int maxCount, Term term, int out) { //assume that the cases when regLen==0 or maxCount==0 are handled by caller int i = off; int iMin = off - maxCount; if (term.type == Term.REG || term.type == Term.REG_I) { /*@since 1.2*/ char first = data[regOff]; regOff++; regLen--; for (; ; ) { i--; if (data[i] == first && compareRegions(data, i + 1, regOff, regLen, out, term)) break; if (i <= iMin) return -1; } }/* else if (term.type == Term.REG_I) { char c, firstChar = Category.caseFold(data[regOff]); regOff++; regLen--; for (; ; ) { i--; if (((c = Category.caseFold(data[i])) == firstChar) && compareRegionsI(data, i + 1, regOff, regLen, out)) break; if (i <= iMin) return -1; } return off - i; }*/ else throw new IllegalArgumentException("wrong findBackReg() target type :" + term.type); return off - i; }
if (compareRegions(data, sampleOffset, i, rLen, end, term)) { i += rLen; term = term.next; while (compareRegions(data, i, sampleOffset, bitset, end, term)) { cnt++; i += bitset; while (countBack > 0 && compareRegions(data, i, sampleOffset, bitset, end, term)) { cnt++; i += bitset;
if (compareRegions(data, sampleOffset, i, rLen, end, term)) { i += rLen; term = term.next; while (compareRegions(data, i, sampleOffset, bitset, end, term)) { cnt++; i += bitset; while (countBack > 0 && compareRegions(data, i, sampleOffset, bitset, end, term)) { cnt++; i += bitset;