Class PointArrayPixellator

java.lang.Object
uk.ac.starlink.ttools.plot.PointArrayPixellator
All Implemented Interfaces:
Pixellator

public class PointArrayPixellator extends Object implements Pixellator
Pixellator based on an array of Point objects. This implementation is designed to be particularly efficient for iterating over.
Since:
28 Mar 2007
Author:
Mark Taylor
  • Constructor Details

    • PointArrayPixellator

      public PointArrayPixellator(Point[] points)
      Constructor.
      Parameters:
      points - array of points to iterate over
  • Method Details

    • getBounds

      public Rectangle getBounds()
      Description copied from interface: Pixellator
      Returns a copy of the bounding rectangle for this pixellator. All points iterated over by this object will fall within this rectangle. If this object has no points, null may be returned.
      Specified by:
      getBounds in interface Pixellator
      Returns:
      bounds
    • start

      public void start()
      Description copied from interface: Pixellator
      Makes this object ready to iterate. Should be called before any call to Pixellator.next().
      Specified by:
      start in interface Pixellator
    • next

      public boolean next()
      Description copied from interface: Pixellator
      Moves to the next point in the sequence. Must be called before any call to Pixellator.getX()/Pixellator.getY(). Returns value indicates whether there is a next point.
      Specified by:
      next in interface Pixellator
      Returns:
      next true iff there are more points
    • getX

      public int getX()
      Description copied from interface: Pixellator
      Returns the X value for the current point.
      Specified by:
      getX in interface Pixellator
      Returns:
      x
    • getY

      public int getY()
      Description copied from interface: Pixellator
      Returns the Y value for the current point.
      Specified by:
      getY in interface Pixellator
      Returns:
      y