- java.lang.Object
-
- org.apache.lucene.geo.Geometry
-
- org.apache.lucene.geo.XYGeometry
-
- org.apache.lucene.geo.XYPolygon
-
public final class XYPolygon extends XYGeometry
Represents a polygon in cartesian space. You can construct the Polygon directly withfloat[]
,float[]
x, y arrays coordinates.
-
-
Field Summary
Fields Modifier and Type Field Description private XYPolygon[]
holes
float
maxX
maximum x of this polygon's bounding box areafloat
maxY
maximum y of this polygon's bounding box areafloat
minX
minimum x of this polygon's bounding box areafloat
minY
minimum y of this polygon's bounding box areaprivate GeoUtils.WindingOrder
windingOrder
winding order of the verticesprivate float[]
x
private float[]
y
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
(package private) XYPolygon
getHole(int i)
XYPolygon[]
getHoles()
Returns a copy of the internal holes arrayfloat[]
getPolyX()
Returns a copy of the internal x arrayfloat
getPolyX(int vertex)
Returns x value at given indexfloat[]
getPolyY()
Returns a copy of the internal y arrayfloat
getPolyY(int vertex)
Returns y value at given indexGeoUtils.WindingOrder
getWindingOrder()
Returns the winding order (CW, COLINEAR, CCW) for the polygon shellint
hashCode()
int
numHoles()
returns the number of holes for the polygonint
numPoints()
returns the number of vertex pointsprotected Component2D
toComponent2D()
get a Component2D from the geometry objectjava.lang.String
toString()
-
Methods inherited from class org.apache.lucene.geo.XYGeometry
create
-
-
-
-
Field Detail
-
x
private final float[] x
-
y
private final float[] y
-
holes
private final XYPolygon[] holes
-
minX
public final float minX
minimum x of this polygon's bounding box area
-
maxX
public final float maxX
maximum x of this polygon's bounding box area
-
minY
public final float minY
minimum y of this polygon's bounding box area
-
maxY
public final float maxY
maximum y of this polygon's bounding box area
-
windingOrder
private final GeoUtils.WindingOrder windingOrder
winding order of the vertices
-
-
Constructor Detail
-
XYPolygon
public XYPolygon(float[] x, float[] y, XYPolygon... holes)
Creates a new Polygon from the supplied x, y arrays, and optionally any holes.
-
-
Method Detail
-
numPoints
public int numPoints()
returns the number of vertex points
-
getPolyX
public float[] getPolyX()
Returns a copy of the internal x array
-
getPolyX
public float getPolyX(int vertex)
Returns x value at given index
-
getPolyY
public float[] getPolyY()
Returns a copy of the internal y array
-
getPolyY
public float getPolyY(int vertex)
Returns y value at given index
-
getHoles
public XYPolygon[] getHoles()
Returns a copy of the internal holes array
-
getHole
XYPolygon getHole(int i)
-
getWindingOrder
public GeoUtils.WindingOrder getWindingOrder()
Returns the winding order (CW, COLINEAR, CCW) for the polygon shell
-
numHoles
public int numHoles()
returns the number of holes for the polygon
-
toComponent2D
protected Component2D toComponent2D()
Description copied from class:Geometry
get a Component2D from the geometry object- Specified by:
toComponent2D
in classGeometry
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-