@Override public void finish() { if (localIterator != null) localIterator.close(); }
public void calcBounds() throws java.io.IOException { if ((dateRange != null) && (boundingBox != null) && (size() > 0)) return; PointFeatureIterator iter = getPointFeatureIterator(-1); iter.setCalculateBounds(this); try { while (iter.hasNext()) iter.next(); } finally { iter.finish(); } }
@Override public PointFeature next() { return pfIter.next(); }
public static boolean equals(PointFeatureIterator iter1, PointFeatureIterator iter2) throws IOException { if (iter1 == iter2) { return true; } else if (iter1 == null || iter2 == null) { return false; } try { while (iter1.hasNext() && iter2.hasNext()) { if (!equals(iter1.next(), iter2.next())) { return false; } } return !(iter1.hasNext() || iter2.hasNext()); } finally { iter1.close(); iter2.close(); } }
/** * Attempts to find a PointFeatureIterator in the currently-loaded DsgFeatureCollection that has another * available element (i.e. {@code hasNext() == true}). Such an iterator may already be loaded into * {@code pfIter}. If not, we'll have to look through {@code pfcIter} and/or {@code pfccIter} to find one. * <p> * That iterator, if it's found, will be assigned to {@code pfIter} and this method will return {@code true}. * Otherwise, it'll return {@code false}, meaning that there are no more unread PointFeatures available in the * currently-loaded DsgFeatureCollection. * * @return {@code true} if {@code pfIter.hasNext()} will now return {@code true}. * @throws IOException if an I/O error occurs. */ private boolean pfIterHasNext() throws IOException { if (pfIter != null) { if (pfIter.hasNext()) { return true; } else { // We'll need to load a new PointFeatureIterator below. But first, close the old one. pfIter.close(); } } while (pfcIterHasNext()) { this.pfIter = pfcIter.next().getPointFeatureIterator(); if (pfIter.hasNext()) { return true; } // else: Iterator could be empty, in which case we proceed to the next loop iteration. } return false; }
@Override public boolean hasNext() throws IOException { if (localIterator == null) resetIteration(); return localIterator.hasNext(); }
public void finish() { if (localIterator != null) localIterator.finish(); }
public PointFeatureIterator getPointFeatureIterator(int bufferSize) throws IOException { // only one Cursor object needed - it will be used for each iteration with different structData's Cursor tableData = new Cursor(ft.getNumberOfLevels()); PointFeatureIterator iter = new StandardPointFeatureIterator( ft, timeUnit, ft.getObsDataIterator(tableData, bufferSize), tableData); if ((boundingBox == null) || (dateRange == null) || (npts < 0)) iter.setCalculateBounds(this); return iter; }
public void setBufferSize(int bytes) { orgIter.setBufferSize(bytes); }
public PointFeature next() throws IOException { npts++; return pfIter.next(); }
@Override public boolean hasNext() { try { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { close(); return false; } } if (!pfIter.hasNext()) { pfIter.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositePointFeatureIterator open dataset %s%n", currentDataset.getLocation()); currentDataset.close(); pfIter = getNextIterator(); return hasNext(); } return true; } catch (IOException ioe) { throw new RuntimeException(ioe); } }
public boolean hasNext() throws IOException { if (localIterator == null) resetIteration(); return localIterator.hasNext(); }
public void finish() { if (localIterator != null) localIterator.finish(); }
public PointFeatureIterator getPointFeatureIterator(int bufferSize) throws IOException { // only one Cursor object needed - it will be used for each iteration with different structData's Cursor tableData = new Cursor(ft.getNumberOfLevels()); PointFeatureIterator iter = new StandardPointFeatureIterator( ft, timeUnit, ft.getObsDataIterator(tableData, bufferSize), tableData); if ((boundingBox == null) || (dateRange == null) || (npts < 0)) iter.setCalculateBounds(this); return iter; }
public void setBufferSize(int bytes) { orgIter.setBufferSize(bytes); }
private PointFeature nextFilteredDataPoint() throws IOException { if (pfiter == null) return null; if (!pfiter.hasNext()) return null; PointFeature pdata = pfiter.next(); if (filter == null) return pdata; while (!filter.filter(pdata)) { if (!pfiter.hasNext()) return null; pdata = pfiter.next(); } return pdata; }
public void calcBounds() throws java.io.IOException { if ((dateRange != null) && (boundingBox != null) && (size() > 0)) return; PointFeatureIterator iter = getPointFeatureIterator(-1); iter.setCalculateBounds(this); try { while (iter.hasNext()) iter.next(); } finally { iter.finish(); } }