edu.umd.cs.piccolox.util
Interface Points

All Known Subinterfaces:
MutablePoints
All Known Implementing Classes:
LineShape, XYArray

public interface Points

Interface for a sequence of points.


Method Summary
 Rectangle2D getBounds(Rectangle2D dst)
          Returns the bounds of all the points taken as a whole.
 Point2D getPoint(int i, Point2D dst)
          Returns a point representation of the coordinates at the given index.
 int getPointCount()
          Returns the number of points in the sequence.
 double getX(int i)
          Returns the x component of the point at the given index.
 double getY(int i)
          Returns the y component of the point at the given index.
 

Method Detail

getPointCount

int getPointCount()
Returns the number of points in the sequence.

Returns:
number of points in the sequence

getX

double getX(int i)
Returns the x component of the point at the given index.

Parameters:
i - index of desired point
Returns:
x component of point

getY

double getY(int i)
Returns the y component of the point at the given index.

Parameters:
i - index of desired point
Returns:
y component of point

getPoint

Point2D getPoint(int i,
                 Point2D dst)
Returns a point representation of the coordinates at the given index.

Parameters:
i - index of desired point
dst - output parameter into which the point's details will be populated, if null a new one will be created.
Returns:
a point representation of the coordinates at the given index

getBounds

Rectangle2D getBounds(Rectangle2D dst)
Returns the bounds of all the points taken as a whole.

Parameters:
dst - output parameter to store bounds into, if null a new rectangle will be created
Returns:
rectangle containing the bounds


Copyright © 1995-2010 Piccolo2D. All Rights Reserved.