protected static void recordPatternInReverse(BitArray row, int start, int[] counters) throws NotFoundException { // This could be more efficient I guess int numTransitionsLeft = counters.length; boolean last = row.get(start); while (start > 0 && numTransitionsLeft >= 0) { if (row.get(--start) != last) { numTransitionsLeft--; last = !last; } } if (numTransitionsLeft >= 0) { throw NotFoundException.getNotFoundInstance(); } recordPattern(row, start + 1, counters); }
protected static void recordPatternInReverse(BitArray row, int start, int[] counters) throws NotFoundException { // This could be more efficient I guess int numTransitionsLeft = counters.length; boolean last = row.get(start); while (start > 0 && numTransitionsLeft >= 0) { if (row.get(--start) != last) { numTransitionsLeft--; last = !last; } } if (numTransitionsLeft >= 0) { throw NotFoundException.getNotFoundInstance(); } recordPattern(row, start + 1, counters); }
protected static void recordPatternInReverse(BitArray row, int start, int[] counters) throws NotFoundException { // This could be more efficient I guess int numTransitionsLeft = counters.length; boolean last = row.get(start); while (start > 0 && numTransitionsLeft >= 0) { if (row.get(--start) != last) { numTransitionsLeft--; last = !last; } } if (numTransitionsLeft >= 0) { throw NotFoundException.getNotFoundInstance(); } recordPattern(row, start + 1, counters); }