Class GeometryCollectionIterator

  • All Implemented Interfaces:
    java.util.Iterator

    public class GeometryCollectionIterator
    extends java.lang.Object
    implements java.util.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.
    Version:
    1.7
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Tests whether any geometry elements remain to be returned.
      java.lang.Object next()
      Gets the next geometry in the iteration sequence.
      void remove()
      Removal is not supported.
      • Methods inherited from class java.lang.Object

        equals, 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 given Geometry.
        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.
        Specified by:
        hasNext in interface java.util.Iterator
        Returns:
        true if more geometry elements remain
      • next

        public java.lang.Object next()
        Gets the next geometry in the iteration sequence.
        Specified by:
        next in interface java.util.Iterator
        Returns:
        the next geometry in the iteration
      • remove

        public void remove()
        Removal is not supported.
        Specified by:
        remove in interface java.util.Iterator
        Throws:
        java.lang.UnsupportedOperationException - This method is not implemented.