Class Polygon

java.lang.Object
   |
   +----Polygon

public class Polygon
extends Object
A class representing a polygon


Constructor Index

 o Polygon()
Construct a polygon with no vertices.
 o Polygon(Vector)
Construct a polygon given a list of vertices.

Method Index

 o getVertices()
Get the vertices of a polygon.
 o nextVertex(Vertex)
Returns the next vertex of a polygon
 o reverse()
Reverse the order of the vertices that define a contour
 o toString()
Returns a string describing a polygon.

Constructors

 o Polygon
 public Polygon()
Construct a polygon with no vertices.

 o Polygon
 public Polygon(Vector v)
Construct a polygon given a list of vertices.

Parameters:
v - the list of vertices

Methods

 o reverse
 public void reverse()
Reverse the order of the vertices that define a contour

 o getVertices
 public Vector getVertices()
Get the vertices of a polygon.

Returns:
Returns a vector p
 o nextVertex
 public Vertex nextVertex(Vertex v)
Returns the next vertex of a polygon

Parameters:
v - the vertex
Returns:
the vertex following v, or null if v is not a vertex of the polygon
 o toString
 public String toString()
Returns a string describing a polygon.

Overrides:
toString in class Object