Class PolygonBound
- java.lang.Object
-
- org.apache.druid.collections.spatial.search.RectangularBound
-
- org.apache.druid.collections.spatial.search.PolygonBound
-
- All Implemented Interfaces:
Bound<float[],ImmutableFloatPoint>
public class PolygonBound extends RectangularBound
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(float[] coords)booleanequals(Object o)Iterable<ImmutableFloatPoint>filter(Iterable<ImmutableFloatPoint> points)static PolygonBoundfrom(float[] abscissa, float[] ordinate)static PolygonBoundfrom(float[] abscissa, float[] ordinate, int limit)abscissa and ordinate contain the coordinates of polygon.float[]getAbscissa()byte[]getCacheKey()float[]getOrdinate()inthashCode()-
Methods inherited from class org.apache.druid.collections.spatial.search.RectangularBound
getLimit, getMaxCoords, getMinCoords, getNumDims, overlaps
-
-
-
-
Method Detail
-
from
public static PolygonBound from(float[] abscissa, float[] ordinate, int limit)
abscissa and ordinate contain the coordinates of polygon. abscissa[i] is the horizontal coordinate for the i'th corner of the polygon, and ordinate[i] is the vertical coordinate for the i'th corner. The polygon must have more than 2 corners, so the length of abscissa or ordinate must be equal or greater than 3. if the polygon is a rectangular, which corners are {0.0, 0.0}, {0.0, 1.0}, {1.0, 1.0}, {1.0, 0.0}, the abscissa should be {0.0, 0.0, 1.0, 1.0} and ordinate should be {0.0, 1.0, 1.0, 0.0}
-
from
public static PolygonBound from(float[] abscissa, float[] ordinate)
-
getOrdinate
public float[] getOrdinate()
-
getAbscissa
public float[] getAbscissa()
-
contains
public boolean contains(float[] coords)
- Specified by:
containsin interfaceBound<float[],ImmutableFloatPoint>- Overrides:
containsin classRectangularBound
-
filter
public Iterable<ImmutableFloatPoint> filter(Iterable<ImmutableFloatPoint> points)
- Specified by:
filterin interfaceBound<float[],ImmutableFloatPoint>- Overrides:
filterin classRectangularBound
-
getCacheKey
public byte[] getCacheKey()
- Specified by:
getCacheKeyin interfaceBound<float[],ImmutableFloatPoint>- Overrides:
getCacheKeyin classRectangularBound
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classRectangularBound
-
hashCode
public int hashCode()
- Overrides:
hashCodein classRectangularBound
-
-