org.gcube.indexmanagement.geo.shape
Class Rectangle

java.lang.Object
  extended by org.gcube.indexmanagement.geo.shape.Rectangle

public class Rectangle
extends Object

A java representation of a rectangle


Constructor Summary
Rectangle(com.vividsolutions.jts.geom.Envelope e)
          A constructor creating a rectangle from a jts Envelope
Rectangle(long x1, long x2, long y1, long y2)
          A constructor creating a rectangle from two X and two Y coordinates
 
Method Summary
 boolean contains(Rectangle r)
          A method which decides if this rectangle contains the specified rectangle.
 boolean containsPoint(long x, long y)
          A method which decides if this rectangle contains the specified point.
 long getMaxX()
          Getter method for the biggest X coordinate
 long getMaxY()
          Getter method for the biggest Y coordinate
 long getMinX()
          Getter method for the smallest X coordinate
 long getMinY()
          Getter method for the smallest Y coordinate
 boolean overlaps(Rectangle r)
          A method which decides if this rectangle overlaps with the specified rectangle.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rectangle

public Rectangle(long x1,
                 long x2,
                 long y1,
                 long y2)
A constructor creating a rectangle from two X and two Y coordinates

Parameters:
x1 - - one of two X coodinates
x2 - - one of two X coodinates
y1 - - one of two Y coodinates
y2 - - one of two Y coodinates

Rectangle

public Rectangle(com.vividsolutions.jts.geom.Envelope e)
A constructor creating a rectangle from a jts Envelope

Parameters:
e - - The jts Envelope to represent as a rectangle
Method Detail

getMinX

public long getMinX()
Getter method for the smallest X coordinate

Returns:
the min X coordinate

getMaxX

public long getMaxX()
Getter method for the biggest X coordinate

Returns:
the max X coordinate

getMinY

public long getMinY()
Getter method for the smallest Y coordinate

Returns:
the min Y coordinate

getMaxY

public long getMaxY()
Getter method for the biggest Y coordinate

Returns:
the max Y coordinate

contains

public boolean contains(Rectangle r)
A method which decides if this rectangle contains the specified rectangle.

Parameters:
r - - The rectangle to test whether is contained by this rectangle.
Returns:
TRUE if this rectangle contains the specified rectangle

containsPoint

public boolean containsPoint(long x,
                             long y)
A method which decides if this rectangle contains the specified point.

Parameters:
x - - The X coordinate of the point to test whether is contained by this rectangle.
y - - The Y coordinate of the point to test whether is contained by this rectangle.
Returns:
TRUE if this rectangle contains the specified point.

overlaps

public boolean overlaps(Rectangle r)
A method which decides if this rectangle overlaps with the specified rectangle.

Parameters:
r - - The rectangle to test whether overlaps with this rectangle.
Returns:
TRUE if this rectangle overlaps with specified rectangle

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.