Package popinjay

Class Shape

  • All Implemented Interfaces:
    java.lang.Iterable<Point>

    public class Shape
    extends java.lang.Object
    implements java.lang.Iterable<Point>
    A Shape represents a puzzle piece as a collection of points. Multiple puzzle pieces may share the same Shape.
    • Constructor Summary

      Constructors 
      Constructor Description
      Shape​(java.lang.String[] rows)
      Create a Shape from an array of strings.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<Point> iterator()
      Iterator for the points of the shape.
      • 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
    • Constructor Detail

      • Shape

        public Shape​(java.lang.String[] rows)
        Create a Shape from an array of strings. Non-space characters represent occupied points.
    • Method Detail

      • iterator

        public java.util.Iterator<Point> iterator()
        Iterator for the points of the shape.
        Specified by:
        iterator in interface java.lang.Iterable<Point>