Package com.attivio.sdk.geo
Class AbstractPolygon
- java.lang.Object
-
- com.attivio.sdk.geo.Shape
-
- com.attivio.sdk.geo.AbstractPolygon
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Shape>
public abstract class AbstractPolygon extends Shape
Abstract polygon definition.WARNING: this API is experimental and will likely change in the near future.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractPolygon()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double
fastGetX(int index)
Get the X coordinate of the Point atindex
.abstract double
fastGetY(int index)
Get the Y coordinate of the Point atindex
.Point
getPoint(int index)
Get the Point atindex
.double
getPointX(int index)
Get the X Coordinate of the Point atindex
.double
getPointY(int index)
Get the X Coordinate of the Point atindex
.protected boolean
intersects(Rectangle box, AbstractPolygon poly)
Check for intersection withpoly
.boolean
intersects(Rectangle box, Shape other)
Check if this shape intersects withother
.abstract boolean
lineIntersects(double x1, double y1, double x2, double y2)
Check if the line (x1, y1), (x2, y2) intersects with this polygon.abstract int
size()
Return the number of vertices in this polygon.-
Methods inherited from class com.attivio.sdk.geo.Shape
addArguments, clone, compareTo, contains, contains, fastIntersects, getBoundingBox, getHeight, getTypeName, getWidth, hashCode, intersects, readExternal, readExternal, toString, toString, toString, valueOf, writeExternal, writeExternal
-
-
-
-
Method Detail
-
getPoint
public final Point getPoint(int index)
Get the Point atindex
.
-
getPointX
public final double getPointX(int index)
Get the X Coordinate of the Point atindex
.
-
getPointY
public final double getPointY(int index)
Get the X Coordinate of the Point atindex
.
-
fastGetX
public abstract double fastGetX(int index)
Get the X coordinate of the Point atindex
.WARNING: this method assumes that
index
is positive and less thansize()
.
-
fastGetY
public abstract double fastGetY(int index)
Get the Y coordinate of the Point atindex
.WARNING: this method assumes that
index
is positive and less thansize()
.
-
size
public abstract int size()
Return the number of vertices in this polygon.
-
intersects
public boolean intersects(Rectangle box, Shape other)
Check if this shape intersects withother
.- Specified by:
intersects
in classShape
- Parameters:
box
- The bounding box of this shape fromShape.getBoundingBox()
.other
- The shape to check for intersection with
-
intersects
protected final boolean intersects(Rectangle box, AbstractPolygon poly)
Check for intersection withpoly
.- Parameters:
box
- This polygon's bounding boxpoly
- Polygon to check intersection with.
-
lineIntersects
public abstract boolean lineIntersects(double x1, double y1, double x2, double y2)
Check if the line (x1, y1), (x2, y2) intersects with this polygon.
-
-