private void findTop() { topKey = null; topValue = null; while (source.hasTop()) { if (inBounds(source.getTopKey())) { topKey = source.getTopKey(); topValue = source.getTopValue(); return; } else { try { source.next(); } catch (final IOException e) { throw new RuntimeException(e); } } } }
@Override public void next() throws IOException { source.next(); findTop(); }
@Override public void next() throws IOException { mapIterator.next(); }
@Override public synchronized void next() throws IOException { source.next(); }