Package it.tidalwave.mapviewer
Class MapArea
java.lang.Object
it.tidalwave.mapviewer.MapArea
A rectangular area on the map.
- Author:
- Fabrizio Giudici
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif this area contains the given area.booleancontains(MapCoordinates coordinates) Returnstrueif this area contains the given coordinates.Returns the center of this area.booleanReturnstrueif this area spans across the Greenwich antimeridian (180° W).static MapAreaof(double north, double east, double south, double west) Returns a new area.toString()
-
Constructor Details
-
MapArea
public MapArea()
-
-
Method Details
-
of
Returns a new area..- Parameters:
north- the north limiteast- the east limitsouth- the south limitwest- the west limit- Returns:
- a new area
- Throws:
IllegalArgumentException- when the values are unfeasible
-
getCenter
Returns the center of this area..- Returns:
- the center of this area
-
isAcrossGreenwichAntimeridian
public boolean isAcrossGreenwichAntimeridian()Returnstrueif this area spans across the Greenwich antimeridian (180° W)..- Returns:
trueif this area spans across the Greenwich antimeridian (180° W)
-
contains
Returnstrueif this area contains the given coordinates..- Parameters:
coordinates- the coordinates- Returns:
trueif this area contains the given coordinates
-
contains
Returnstrueif this area contains the given area..- Parameters:
that- the area to compare- Returns:
trueif this area contains the given area
-
toString
-