Class CoastlineShape

java.lang.Object
  extended byCoastlineShape

public class CoastlineShape
extends java.lang.Object

Represents one coastline shape.

Author:
Lulin Song

Method Summary
 void addPoint(LatLon p)
          Add a point to the shape.
 float[] getLatitudes()
          Get latitudes of the shape.
 float[] getLongitudes()
          Get longitudes of the shape.
 boolean isInBoudingBox(float maxLat, float maxLon, float minLat, float minLon)
          Test if the shape is in given bounding box.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isInBoudingBox

public boolean isInBoudingBox(float maxLat,
                              float maxLon,
                              float minLat,
                              float minLon)
Test if the shape is in given bounding box.

Parameters:
maxLat - maximum of latitude of bounding box
maxLon - maximum of longitude of bounding box
minLat - minimum of latitude of bounding box
minLon - minimum of longitude of bounding box
Returns:
true if the shape is in given bounding box, otherwise false;

getLatitudes

public float[] getLatitudes()
Get latitudes of the shape.

Returns:
an array of float represents the shape's latitudes in degree, null returned if the shape is not valid.

getLongitudes

public float[] getLongitudes()
Get longitudes of the shape.

Returns:
an array of float represents the shape's longitudes in degree, null returned if the shape is not valid.

addPoint

public void addPoint(LatLon p)
Add a point to the shape.

Parameters:
p - one point on the shape.