public final class Rectangle extends Object implements Geometry, HasGeometry
| Modifier | Constructor and Description |
|---|---|
protected |
Rectangle(float x1,
float y1,
float x2,
float y2) |
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
add(Rectangle r) |
float |
area() |
boolean |
contains(double x,
double y) |
static Rectangle |
create(double x1,
double y1,
double x2,
double y2) |
static Rectangle |
create(float x1,
float y1,
float x2,
float y2) |
double |
distance(Rectangle r)
Returns the distance to the given
Rectangle. |
boolean |
equals(Object obj) |
Geometry |
geometry() |
int |
hashCode() |
float |
intersectionArea(Rectangle r) |
boolean |
intersects(Rectangle r) |
Rectangle |
mbr()
Returns the minimum bounding rectangle of this geometry.
|
float |
perimeter() |
String |
toString() |
float |
x1() |
float |
x2() |
float |
y1() |
float |
y2() |
public float x1()
public float y1()
public float x2()
public float y2()
public float area()
public static Rectangle create(double x1, double y1, double x2, double y2)
public static Rectangle create(float x1, float y1, float x2, float y2)
public boolean contains(double x,
double y)
public boolean intersects(Rectangle r)
intersects in interface Geometrypublic Rectangle mbr()
Geometrypublic float intersectionArea(Rectangle r)
public float perimeter()
public Geometry geometry()
geometry in interface HasGeometryCopyright © 2013–2015. All rights reserved.