@Override protected E findNext() { if (pos == count) return null; while (true) { E next = sequence.next(); if (next == null) { pos++; if (pos == count) return null; sequence = sequence.copy(); } else return next; } }
@Override public int length() { return sequence.length() * count; }
@Override public RepeatSequence<E> copy() { return new RepeatSequence<E>(sequence.copy(), count); }
private void _reset() { sequence = sequence.copy(); pos = 0; }