public Iterator iterator() { return delegate.iterator(); }
public Iterator<SimpleFeature> iterator() { final Iterator<SimpleFeature> iterator = backendCollection.iterator(); return new Iterator<SimpleFeature>() { public boolean hasNext() { return iterator.hasNext(); } public SimpleFeature next() { SimpleFeature feature = (SimpleFeature) iterator.next(); return new PreGeneralizedSimpleFeature(featureType, indexMapping, feature, geomPropertyName, backendGeomPropertyName); } public void remove() { throw unsupported(); } public void close() { backendCollection.close(iterator); } }; }
public Iterator<SimpleFeature> iterator() { try { return new ReprojectingIterator(delegate.iterator(), transform, schema, transformer); } catch (Exception e) { throw new RuntimeException(e); } }
public Iterator<SimpleFeature> iterator() { return new MaxFeaturesIterator<SimpleFeature>( delegate.iterator(), start, max ); }
/** * Create a new instance. * * @param featuresArg a FeatureCollection. <b>All features must be of the same FeatureType</b> * @param typeArg the Feature type of of the features. */ public CollectionFeatureReader(SimpleFeatureCollection featuresArg, SimpleFeatureType typeArg) { assert !featuresArg.isEmpty(); collection = featuresArg; this.features = featuresArg.iterator(); this.type = typeArg; }
public Iterator<SimpleFeature> iterator() { return new FilteringIterator<SimpleFeature>( delegate.iterator(), filter ); }
static void accept(SimpleFeatureCollection collection, FeatureVisitor[] visitors) { Iterator iterator; for (iterator = collection.iterator(); iterator.hasNext();) { SimpleFeature feature = (SimpleFeature) iterator.next(); for (int i = 0; i < visitors.length; i++) { FeatureVisitor visitor = visitors[i]; visitor.visit(feature); } } collection.close(iterator); }
/** * Navigate the collection and call vistor.visit( Feature ) for each * element in the collection. * * @param collection the SimpleFeatureCollection containing the features we want to visit * @param visitor the visitor which already knows which attributes it wants to meet */ static void accept(SimpleFeatureCollection collection, FeatureVisitor visitor) { Iterator iterator; for (iterator = collection.iterator(); iterator.hasNext();) { SimpleFeature feature = (SimpleFeature) iterator.next(); visitor.visit(feature); } collection.close(iterator); }
public Iterator<SimpleFeature> iterator() { return new ReTypingIterator( delegate.iterator(), delegate.getSchema(), featureType ); }
Iterator i = features.iterator(); try { while (i.hasNext()) {
Iterator it = fc.iterator(); int count = 0;
public void testAddRemoveAllAbilities() throws Exception { Collection half = randomPiece(features); Collection otherHalf = DataUtilities.list(features); otherHalf.removeAll(half); features.removeAll(half); assertTrue(features.containsAll(otherHalf)); assertTrue(!features.containsAll(half)); features.removeAll(otherHalf); assertTrue(features.size() == 0); features.addAll(half); assertTrue(features.containsAll(half)); features.addAll(otherHalf); assertTrue(features.containsAll(otherHalf)); features.retainAll(otherHalf); assertTrue(features.containsAll(otherHalf)); assertTrue(!features.containsAll(half)); features.addAll(otherHalf); Iterator i = features.iterator(); while (i.hasNext()) { i.next(); i.remove(); } assertEquals(features.size(), 0); SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder(); tb.setName("XXX"); SimpleFeatureBuilder b = new SimpleFeatureBuilder(tb.buildFeatureType()); assertTrue(!features.remove(b.buildFeature(null))); }