|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.v3x.graphics.IntegerRectangle
public class IntegerRectangle
A rectangle in whole-number space. Because whole numbers are part of this nutritious breakfast.
| Field Summary | |
|---|---|
int |
east
|
int |
north
|
int |
south
|
int |
west
|
| Constructor Summary | |
|---|---|
IntegerRectangle()
Create a new IntegerRectangle. |
|
IntegerRectangle(int west,
int south,
int east,
int north)
Create a new IntegerRectangle with given west, south, east and north. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
boolean |
covers(IntegerRectangle nother)
Returns true if this rectangle covers the given one. |
int |
getArea()
Area (width * height) |
int |
getEast()
Maximum x coordinate (east edge) |
int |
getHeight()
Height - keep in mind a rectangle with the same north and south coords has a height of 1, not zero. |
int |
getNorth()
Maximum y coordinate (north edge) |
int |
getSouth()
Minimum y coordinate (southern edge) |
int |
getWest()
Minimum x coordinate (western edge) |
int |
getWidth()
Width - keep in mind a rectangle with the same east and west coords has a width of 1, not zero |
int |
getX()
Minimum x (same as west) |
int |
getY()
Minimum y (same as south) |
IntegerRectangle |
intersection(IntegerRectangle nother)
Returns the intersection of the given rectangle with this (returns null if there is none) |
boolean |
intersects(IntegerRectangle nother)
Returns true if the given rectangle intersects this one. |
void |
setEast(int newEast)
Maximum x coordinate (east edge) |
void |
setNorth(int newNorth)
Maximum y coordinate (north edge) |
void |
setSouth(int newSouth)
Minimum y coordinate (southern edge) |
void |
setWest(int newWest)
Minimum x coordinate (western edge) |
java.lang.String |
toString()
|
java.util.ArrayList |
trimmings(IntegerRectangle nother)
Returns a list of rectangles formed when the given rectangle is cropped by this one. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int west
public int south
public int east
public int north
| Constructor Detail |
|---|
public IntegerRectangle()
public IntegerRectangle(int west,
int south,
int east,
int north)
| Method Detail |
|---|
public boolean intersects(IntegerRectangle nother)
public boolean covers(IntegerRectangle nother)
public IntegerRectangle intersection(IntegerRectangle nother)
public java.util.ArrayList trimmings(IntegerRectangle nother)
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getWest()
public void setWest(int newWest)
public int getSouth()
public void setSouth(int newSouth)
public int getEast()
public void setEast(int newEast)
public int getNorth()
public void setNorth(int newNorth)
public int getArea()
public int getX()
public int getY()
public int getWidth()
public int getHeight()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||