This is an explicit interface for FeatureIterator. Sample use: SimpleFeatureIterator i = featureCollection.features() try { while( i.hasNext() ){ SimpleFeature feature = i.next(); } } finally { i.close(); } @author Jody Garnett @source $URL$
Sample use:
SimpleFeatureIterator i = featureCollection.features() try { while( i.hasNext() ){ SimpleFeature feature = i.next(); } } finally { i.close(); }
425426427428429430431432433434435436437438439440441442
String typeName = tmpFile.getName().substring(0, tmpFile.getName().lastIndexOf(".csv")); SimpleFeatureCollection fc = s.getFeatureSource(typeName).getFeatures(); assertEquals(features.size(), fc.size()); // Read int c = 0; SimpleFeatureIterator it = fc.features(); try { while (it.hasNext()) { SimpleFeature f = it.next(); assertNotNull(f); assertNotNull(f.getDefaultGeometry()); c++; } } finally { it.close(); } assertEquals(fc.size(), c); }