Class CubeCoordinate.RingIterator

  • All Implemented Interfaces:
    java.lang.Iterable<CubeCoordinate>, java.util.Iterator<CubeCoordinate>
    Enclosing class:
    CubeCoordinate

    public class CubeCoordinate.RingIterator
    extends java.lang.Object
    implements java.util.Iterator<CubeCoordinate>, java.lang.Iterable<CubeCoordinate>
    The RingIterator is a Iterator and Iterable over CubeCoordinate's. Use this Iterator to iterate over the outline of a hexagon, with a given center and radius.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      java.util.Iterator<CubeCoordinate> iterator()  
      CubeCoordinate next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • RingIterator

        public RingIterator​(CubeCoordinate center,
                            int radius)
        Constructs a new RingIterator with a center and radius. The iterator will iterate over a hexagon outline.
        Parameters:
        center - center of the hexagon
        radius - radius of the hexagon
      • RingIterator

        public RingIterator​(CubeCoordinate.RingIterator iter)
        Creates a copy of another RingIterator.
        Parameters:
        iter - RingIterator to copy.