Package org.htmlunit.util.geometry
Class Polygon2D
- java.lang.Object
-
- org.htmlunit.util.geometry.Polygon2D
-
-
Field Summary
Fields Modifier and Type Field Description private Rectangle2D
boundingBox_
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 boolean
contains(double x, double y)
boolean
isEmpty()
Polygon2D
lineTo(double x, double y)
Add another corner Point to the polygon.java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
-