Package org.htmlunit.util.geometry
Class Polygon2D
- java.lang.Object
-
- org.htmlunit.util.geometry.Polygon2D
-
-
Field Summary
Fields Modifier and Type Field Description private Rectangle2DboundingBox_private java.util.ArrayList<Point2D>points_
-
Constructor Summary
Constructors Constructor Description Polygon2D(double startX, double startY)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)booleanisEmpty()Polygon2DlineTo(double x, double y)Add another corner Point to the polygon.java.lang.StringtoString()
-
-
-
Field Detail
-
points_
private final java.util.ArrayList<Point2D> points_
-
boundingBox_
private final Rectangle2D boundingBox_
-
-
Constructor Detail
-
Polygon2D
public Polygon2D(double startX, double startY)Ctor.- Parameters:
startX- the x value of the first point.startY- the Y value of the first point.- See Also:
lineTo(double, double)
-
-
Method Detail
-
lineTo
public Polygon2D lineTo(double x, double y)
Add another corner Point to the polygon.- Parameters:
x- the x value of the corner to be addedy- the y value of the corner to be added- Returns:
- this to support fluent style construction
-
contains
public boolean contains(double x, double y)
-
isEmpty
public boolean isEmpty()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-