public boolean hasNext() throws IOException { return delegate.hasNext(); }
@Override public boolean hasNext() throws IOException { return wrapped.hasNext(); }
/** * @return <code>true</code> if the featureReader has not passed the max and still has more * features. * @throws IOException If the reader we are filtering encounters a problem */ public boolean hasNext() throws IOException { return (featureReader.hasNext() && (counter < maxFeatures)); } }
public boolean hasNext() throws IOException { return reader.hasNext(); }
@Override public boolean hasNext() throws IOException { return r.hasNext(); }
/** @see org.geotools.data.FeatureReader#hasNext() */ public boolean hasNext() throws IOException { return reader.hasNext(); }
public boolean hasNext() throws IOException { return reader.hasNext(); }
public boolean hasNext() throws IOException { return backendReader.hasNext(); }
@Test public void testFeatureReaderFidFilter() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED, fidFilter), Transaction.AUTO_COMMIT); assertEquals(primitive, fr.getFeatureType()); assertTrue(fr.hasNext()); SimpleFeature sf = fr.next(); assertFalse(fr.hasNext()); fr.close(); assertEquals(fid, sf.getID()); }
/** @see org.geotools.data.FeatureReader#hasNext() */ public boolean hasNext() throws IOException { if (reader == null) { throw new IllegalStateException("Reader has already been closed"); } return reader.hasNext(); }
public boolean hasNext() { try { return delegate.hasNext(); } catch (IOException e) { throw new RuntimeException(e); } }
@Test public void testFeautureReaderFidFilter() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED, fidFilter), Transaction.AUTO_COMMIT); assertEquals(RENAMED, fr.getFeatureType().getName().getLocalPart()); assertTrue(fr.hasNext()); SimpleFeature sf = fr.next(); assertFalse(fr.hasNext()); fr.close(); assertEquals(fid, sf.getID()); }
/** @see FeatureWriter#hasNext() */ public final boolean hasNext() throws IOException { // filteredContent may be null because we // took the precaution of closing it in a previous call // to this method final boolean hasNext = filteredContent != null && filteredContent.hasNext(); // be cautious of badly coded clients if (!hasNext && filteredContent != null) { filteredContent.close(); filteredContent = null; } return hasNext; }
public boolean hasNext() { try { return reader.hasNext(); } catch (IOException e) { throw new AssertionError(e); } }
void dump(FeatureReader<SimpleFeatureType, SimpleFeature> reader) throws NoSuchElementException, IOException { SimpleFeature feature; int count = 0; try { while (reader.hasNext()) { feature = reader.next(); // System.out.println(count + " feature:" + feature); count++; } } finally { reader.close(); } }
public void testGetFeatureReader() throws IOException { FeatureReader<SimpleFeatureType, SimpleFeature> reader = data.getFeatureSource("road").getReader(); assertCovered(roadFeatures, reader); assertEquals(false, reader.hasNext()); }
public void testGetFeatures() throws Exception { try (FeatureReader r = dataStore.getFeatureReader(new Query(tname("b")), Transaction.AUTO_COMMIT)) { r.hasNext(); SimpleFeature f = (SimpleFeature) r.next(); assertEquals(Boolean.FALSE, f.getAttribute("boolProperty")); r.hasNext(); f = (SimpleFeature) r.next(); assertEquals(Boolean.TRUE, f.getAttribute("boolProperty")); } } }
public void testGetFeatureReaderLake() throws IOException, IllegalFilterException { try (Transaction t = new DefaultTransaction(); FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(new Query(tname("lake")), t)) { assertNotNull(reader); assertTrue(reader.hasNext()); assertNotNull(reader.next()); assertFalse(reader.hasNext()); } }
public void testReader() throws Exception { if (!isGeographySupportAvailable()) { return; } Query q = new Query(tname("geopoint")); try (FeatureReader r = dataStore.getFeatureReader(q, Transaction.AUTO_COMMIT)) { assertTrue(r.hasNext()); while (r.hasNext()) { SimpleFeature f = (SimpleFeature) r.next(); assertTrue(f.getAttribute(aname("geo")) instanceof Point); } } }
public void testOutsideWorld() throws Exception { if (!isGeographySupportAvailable()) { return; } FilterFactory ff = CommonFactoryFinder.getFilterFactory(null); BBOX bbox = ff.bbox("", -300, -40, -200, 40, "EPSG:4326"); // should select everything without bombing out Query q = new Query(tname("geopoint")); q.setFilter(bbox); try (FeatureReader r = dataStore.getFeatureReader(q, Transaction.AUTO_COMMIT)) { assertFalse(r.hasNext()); } }