jp.sf.mapswidgets
Class Bounds

java.lang.Object
  extended by jp.sf.mapswidgets.Bounds
All Implemented Interfaces:
java.lang.Cloneable

public final class Bounds
extends java.lang.Object
implements java.lang.Cloneable

Instance of this class represents 2-dimensional bounding box.

If the Bounds is in the latitude/longitude coordinate system, the x coordinates represent longitude and the y coordinates represent latitude. If the latitude/longitude bounds crosses the International Date Line, the "minimum" coordinates refer to the top left coordinates rather than the mathematical minimum of the two coordinates.

The top left corner of the box is specified by its minX and minY values, and the bottom right corner of the box is specified by its maxX and maxY.

Application code does not need to explicitly release the resources managed by each instance when those instances are no longer required, and thus no dispose() method is provided.

See Google Maps API documentation [Class Reference > GBounds].

See Also:
Point, Size

Constructor Summary
Bounds(double minX, double minY, double maxX, double maxY)
          Construct a new instance of this class given the minX, minY, maxX and maxY values.
 
Method Summary
 Bounds clone()
           
 boolean equals(java.lang.Object tested)
           
 double getMaxX()
          Get the x coordinate of the bottom right of the bounds.
 double getMaxY()
          Get the y coordinate of the bottom right of the bounds.
 double getMinX()
          Get the x coordinate of the top left of the bounds.
 double getMinY()
          Get the y coordinate of the top left of the bounds.
 int hashCode()
           
 void setMaxX(double maxX)
          Set the x coordinate of the bottom right of the bounds.
 void setMaxY(double maxY)
          Set the y coordinate of the bottom right of the bounds.
 void setMinX(double minX)
          Set the x coordinate of the top left of the bounds.
 void setMinY(double minY)
          Set the y coordinate of the top left of the bounds.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bounds

public Bounds(double minX,
              double minY,
              double maxX,
              double maxY)
Construct a new instance of this class given the minX, minY, maxX and maxY values.

Parameters:
minX - the x coordinate of the top left corner of the bounds
minY - the y coordinate of the top left corner of the bounds
maxX - the x coordinate of the bottom right corner of the bounds
maxY - the y coordinate of the bottom right corner of the bounds
Method Detail

clone

public Bounds clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object tested)
Overrides:
equals in class java.lang.Object

getMaxX

public double getMaxX()
Get the x coordinate of the bottom right of the bounds.

See Google Maps API documentation [Class Reference > GBounds > maxX].

Returns:
the x coordinate of the bottom right of the bounds

getMaxY

public double getMaxY()
Get the y coordinate of the bottom right of the bounds.

See Google Maps API documentation [Class Reference > GBounds > maxY].

Returns:
the y coordinate of the bottom right of the bounds

getMinX

public double getMinX()
Get the x coordinate of the top left of the bounds.

See Google Maps API documentation [Class Reference > GBounds > minX].

Returns:
the x coordinate of the top left of the bounds

getMinY

public double getMinY()
Get the y coordinate of the top left of the bounds.

See Google Maps API documentation [Class Reference > GBounds > minY].

Returns:
the y coordinate of the top left of the bounds

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setMaxX

public void setMaxX(double maxX)
Set the x coordinate of the bottom right of the bounds.

See Google Maps API documentation [Class Reference > GBounds > maxX].

Parameters:
maxX - the x coordinate of bottom right left of the bounds

setMaxY

public void setMaxY(double maxY)
Set the y coordinate of the bottom right of the bounds.

See Google Maps API documentation [Class Reference > GBounds > maxY].

Parameters:
maxY - the y coordinate of bottom right left of the bounds

setMinX

public void setMinX(double minX)
Set the x coordinate of the top left of the bounds.

See Google Maps API documentation [Class Reference > GBounds > minX].

Parameters:
minX - the x coordinate of the top left of the bounds

setMinY

public void setMinY(double minY)
Set the y coordinate of the top left of the bounds.

See Google Maps API documentation [Class Reference > GBounds > minY].

Parameters:
minY - the y coordinate of the top left of the bounds

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object