|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.microedition.location.GeographicArea javax.microedition.location.CircleGeographicArea
public class CircleGeographicArea
This class represents a circular geographical area on WGS 84 Ellipsoid
(see reference [WGS84]). Applications can use this object to request services,
for example, from the
MapServiceProvider
.
A circular geographic area is a circular area on a surface of the WGS 84 Ellipsoid. The area is formed by a track of points on the distance of the radius from the center point. The track follows the surface of the earth.
This class is immutable. It means that if an application wants to modify the circular geographic area, it must instantiate a new object for the new area.
Constructor Summary | |
---|---|
CircleGeographicArea(Coordinates center,
float radius)
Constructs a CircleGeographicArea object. |
Method Summary | |
---|---|
boolean |
containsCoordinates(Coordinates coordinate)
With this method an application can check if the given coordinate is inside this GeographicArea object. |
boolean |
equals(java.lang.Object obj)
Overriding the equals method in Object class
to compare the equality of values in two CircleGeographicArea
objects. |
RectangleGeographicArea |
getBoundingBox()
Returns the RectangleGeographicArea object that surrounds
this geographic area completely. |
Coordinates |
getCenterPoint()
Returns the coordinates of the center point of this geographic area. |
float |
getRadius()
Returns the radius of the CircleGeographicArea that was given
in the constructor. |
int |
hashCode()
Overriding the hashCode method in Object class. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CircleGeographicArea(Coordinates center, float radius)
Constructs a CircleGeographicArea
object. The radius is given
in meters.
If the distance from center point to a pole is less than or equal to
radius
, implicating that the area contains a pole, an
IllegalArgumentException
is thrown. This restriction is needed
because the bounding box for that area can not be constructed.
center
- center point of the circular geographic arearadius
- radius of the geographic area in meters
java.lang.IllegalArgumentException
- if radius
< 0.0
or if the resulting area goes over the polar areas
java.lang.NullPointerException
- if center
is null
Method Detail |
---|
public float getRadius()
Returns the radius of the CircleGeographicArea
that was given
in the constructor.
public boolean containsCoordinates(Coordinates coordinate)
GeographicArea
With this method an application can check if the given coordinate is
inside this GeographicArea
object. If the given coordinate is
null
, false
is returned.
containsCoordinates
in class GeographicArea
coordinate
- a coordinates to be checked
true
, if the given point is inside this geographical
area, else false
public RectangleGeographicArea getBoundingBox()
GeographicArea
Returns the RectangleGeographicArea
object that surrounds
this geographic area completely. This is the smallest rectangle that can
be drawn around the area. If the area is bigger than what is allowed in
WGS 84 coordinate system, the rectangle is truncated to valid WGS 84
coordinate values. The RectangeleGeographicArea
is always aligned with parallels and meridians.
getBoundingBox
in class GeographicArea
RectangleGeographicArea
object containing this areapublic Coordinates getCenterPoint()
GeographicArea
Returns the coordinates of the center point of this geographic area.
getCenterPoint
in class GeographicArea
public boolean equals(java.lang.Object obj)
Overriding the equals
method in Object
class
to compare the equality of values in two CircleGeographicArea
objects.
equals
in class java.lang.Object
obj
- object to which the comparison is done
true
if objects are equal, else false
public int hashCode()
Overriding the hashCode
method in Object
class.
The method returns a hash code value for the circle geographic area object.
Two CircleGeographicArea
objects that are equal
must have the same hash code. For more information see
java.lang.Object.hashCode()
method.
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |