|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.geometry.Region
public class Region
An immutable rectangular region in the plane. This immutable class represents a rectangle as two sets of X and Y co-ordinates.
Constructor Summary | |
---|---|
Region(double x1,
double y1,
double x2,
double y2)
Create a Point from individual co-ordinates. |
Method Summary | |
---|---|
double |
getHeight()
Get the height of this region. |
double |
getWidth()
Get the width of this region. |
double |
getX1()
Get the lower X co-ordinate of this region. |
double |
getX2()
Get the upper X co-ordinate of this region. |
double |
getY1()
Get the lower Y co-ordinate of this region. |
double |
getY2()
Get the upper Y co-ordinate of this region. |
Point |
randomPoint()
Get a random point within this region. |
java.lang.String |
toString()
Convert this instance to a String suitable for display. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Region(double x1, double y1, double x2, double y2)
x1
- One X co-ordinate.y1
- One Y co-ordinate.x2
- The other X co-ordinate.y2
- The other Y co-ordinate.Method Detail |
---|
public double getX1()
public double getY1()
public double getX2()
public double getY2()
public double getWidth()
public double getHeight()
public Point randomPoint()
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 |