@Override public boolean hasNext() { if(nextLoadedRecord == null) { loadNextRecord(); } return nextLoadedRecord != null && (foundRecords <= limit || limit == -1); }
@Override public RecordResultImpl next() { if(nextLoadedRecord == null) { loadNextRecord(); } RecordResultImpl loadedRecord = nextLoadedRecord; nextLoadedRecord = null; return loadedRecord; }