Package popinjay

Class Piece

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

    public class Piece
    extends java.lang.Object
    implements java.lang.Iterable<Point>
    A Piece represents a puzzle piece, which is a Shape that has been rotated, flipped, and translated to some position on a Board by an affine transformation. Each Piece also has a unique index used to identify it.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int index  
      Shape shape  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<Point> iterator()
      Return an Iterable for the points of the piece, which are the transformed points of its 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
    • Field Detail

      • shape

        public final Shape shape
      • index

        public final int index
    • Method Detail

      • iterator

        public java.util.Iterator<Point> iterator()
        Return an Iterable for the points of the piece, which are the transformed points of its shape.
        Specified by:
        iterator in interface java.lang.Iterable<Point>