net.agmodel.physical
Class GeographicalPolygon
java.lang.Object
|
+--net.agmodel.physical.GeographicalPolygon
- All Implemented Interfaces:
- GeographicalArea, Serializable
- public class GeographicalPolygon
- extends Object
- implements Serializable, GeographicalArea
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNKNOWN
public static final GeographicalPolygon UNKNOWN
GeographicalPolygon
public GeographicalPolygon(Location2D[] boundary)
getPointCount
public int getPointCount()
getPoint
public Location2D getPoint(int i)
contains
public boolean contains(Location2D point)
- Description copied from interface:
GeographicalArea
- Indicate whether a point is within the area
- Specified by:
contains in interface GeographicalArea
- Parameters:
point - the point of interest
- Returns:
- true if it is, and false if it isn't
getBoundingBox
public GeographicalBox getBoundingBox()
- Description copied from interface:
GeographicalArea
- Return a box which bounds the area.
This can be used as the basis of approximate implementations of
overlapsWith
for arbitrary shapes.
If isUnknown() returns true for the area, then returns GeographicalBox.UNKNOWN
- Specified by:
getBoundingBox in interface GeographicalArea
- Returns:
- a 3 dimensional bounding box
overlapsWith
public boolean overlapsWith(GeographicalArea area)
- Description copied from interface:
GeographicalArea
- Indicate whether the supplied area overlaps with this area.
See
getBoundingBox for a way of approximately
implementing this for arbitrary shapes. Suggestions for improvement welcome.
If isUnknown() returns true for either or both areas, the result is false;
- Specified by:
overlapsWith in interface GeographicalArea
- Parameters:
area - the area of interest
isUnknown
public boolean isUnknown()
- Description copied from interface:
GeographicalArea
- Indicates whether the bounds of this area are unknown.
- Specified by:
isUnknown in interface GeographicalArea
- Returns:
- true if the bounds are unknown.