Package org.locationtech.jts.geom
Class GeometryCollectionIterator
- java.lang.Object
-
- org.locationtech.jts.geom.GeometryCollectionIterator
-
- All Implemented Interfaces:
Iterator
public class GeometryCollectionIterator extends Object implements Iterator
Iterates over allGeometrys in aGeometry, (which may be either a collection or an atomic geometry). The iteration sequence follows a pre-order, depth-first traversal of the structure of theGeometryCollection(which may be nested). The originalGeometryobject is returned as well (as the first object), as are all sub-collections and atomic elements. It is simple to ignore the intermediateGeometryCollectionobjects if they are not needed.- Version:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description GeometryCollectionIterator(Geometry parent)Constructs an iterator over the givenGeometry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Tests whether any geometry elements remain to be returned.Objectnext()Gets the next geometry in the iteration sequence.voidremove()Removal is not supported.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
GeometryCollectionIterator
public GeometryCollectionIterator(Geometry parent)
Constructs an iterator over the givenGeometry.- Parameters:
parent- the geometry over which to iterate; also, the first element returned by the iterator.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Tests whether any geometry elements remain to be returned.
-
next
public Object next()
Gets the next geometry in the iteration sequence.
-
remove
public void remove()
Removal is not supported.- Specified by:
removein interfaceIterator- Throws:
UnsupportedOperationException- This method is not implemented.
-
-