Class GeometryCollectionIterator

Hierarchy: Object , GeometryCollectionIterator
All Implemented Interfaces: Iterator
public class GeometryCollectionIterator
implements Iterator
Iterates over all Geometrys in a Geometry, (which may be either a collection or an atomic geometry). The iteration sequence follows a pre-order, depth-first traversal of the structure of the GeometryCollection (which may be nested). The original Geometry object is returned as well (as the first object), as are all sub-collections and atomic elements. It is simple to ignore the intermediate GeometryCollection objects if they are not needed.

Other

  • version: 1.7
public GeometryCollectionIterator(Geometry parent)
Constructs an iterator over the given Geometry.
Parameters:
parent - parent the geometry over which to iterate; also, the first element returned by the iterator.
public boolean hasNext()
Tests whether any geometry elements remain to be returned.
Returns:
true if more geometry elements remain
public Object next()
Gets the next geometry in the iteration sequence.
Returns:
the next geometry in the iteration
public void remove()
Removal is not supported.
Throws:
UnsupportedOperationException - UnsupportedOperationException This method is not implemented.