|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.garret.perst.Rectangle
public class Rectangle
R2 rectangle class. This class is used in spatial index.
| Constructor Summary | |
|---|---|
Rectangle()
Default constructor for PERST |
|
Rectangle(int top,
int left,
int bottom,
int right)
Construct rectangle with specified coordinates |
|
Rectangle(Rectangle r)
Create copy of the rectangle |
|
| Method Summary | |
|---|---|
long |
area()
Rectangle area |
java.lang.Object |
clone()
Clone rectangle |
boolean |
contains(Rectangle r)
Checks if this rectangle contains the specified rectangle |
boolean |
equals(java.lang.Object o)
Check if two rectangles are equal |
int |
getBottom()
Greatest Y coordinate of the rectangle |
int |
getLeft()
Smallest X coordinate of the rectangle |
int |
getRight()
Greatest X coordinate of the rectangle |
int |
getTop()
Smallest Y coordinate of the rectangle |
int |
hashCode()
Hash code consists of all rectangle coordinates |
boolean |
intersects(Rectangle r)
Checks if this rectangle intersects with specified rectangle |
void |
join(Rectangle r)
Join two rectangles. |
static Rectangle |
join(Rectangle a,
Rectangle b)
Non destructive join of two rectangles. |
static long |
joinArea(Rectangle a,
Rectangle b)
Area of covered rectangle for two sepcified rectangles |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Rectangle()
public Rectangle(int top,
int left,
int bottom,
int right)
public Rectangle(Rectangle r)
| Method Detail |
|---|
public final long area()
public java.lang.Object clone()
clone in class java.lang.Objectpublic final boolean contains(Rectangle r)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic final int getBottom()
public final int getLeft()
public final int getRight()
public final int getTop()
public int hashCode()
hashCode in class java.lang.Objectpublic final boolean intersects(Rectangle r)
public final void join(Rectangle r)
r - rectangle to be joined with this rectangle
public static Rectangle join(Rectangle a,
Rectangle b)
a - first joined rectangleb - second joined rectangle
public static long joinArea(Rectangle a,
Rectangle b)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||