public boolean hasNext() throws IOException { pointFeature = nextFilteredDataPoint(); boolean done = (pointFeature == null); if (done) finish(); return !done; }
public boolean hasNext() throws IOException { pointFeature = nextFilteredDataPoint(); boolean done = (pointFeature == null); if (done) finish(); return !done; }
/** * Returns {@code true} if the iteration has more elements. (In other words, returns {@code true} if {@link #next} * would return an element rather than throwing an exception.) * <p/> * This method is <i>idempotent</i>, meaning that when it is called repeatedly without an intervening * {@link #next}, calls after the first will have no effect. * * @return {@code true} if the iteration has more elements */ // PointFeatureIterator.hasNext() doesn't guarantee idempotency, but we do. @Override public boolean hasNext() { if (pointFeature != null) { return true; // pointFeature hasn't yet been consumed. } pointFeature = nextFilteredDataPoint(); if (pointFeature == null) { close(); return false; } else { return true; } }