Class Polygon
java.lang.Object
|
+----Polygon
- public class Polygon
- extends Object
A class representing a polygon
-
Polygon()
- Construct a polygon with no vertices.
-
Polygon(Vector)
- Construct a polygon given a list of vertices.
-
getVertices()
- Get the vertices of a polygon.
-
nextVertex(Vertex)
- Returns the next vertex of a polygon
-
reverse()
- Reverse the order of the vertices that define a contour
-
toString()
- Returns a string describing a polygon.
Polygon
public Polygon()
- Construct a polygon with no vertices.
Polygon
public Polygon(Vector v)
- Construct a polygon given a list of vertices.
- Parameters:
- v - the list of vertices
reverse
public void reverse()
- Reverse the order of the vertices that define a contour
getVertices
public Vector getVertices()
- Get the vertices of a polygon.
- Returns:
- Returns a vector p
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
toString
public String toString()
- Returns a string describing a polygon.
- Overrides:
- toString in class Object