|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
rle.core.board.RLRectangle
public final class RLRectangle
Immutable object for specifying rectangular regions on the Board.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
|---|
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
| Field Summary | |
|---|---|
int |
height
|
int |
width
|
int |
x
|
int |
y
|
| Fields inherited from class java.awt.geom.Rectangle2D |
|---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
| Constructor Summary | |
|---|---|
RLRectangle(int x,
int y,
int wid,
int hgt)
|
|
| Method Summary | |
|---|---|
java.awt.geom.Rectangle2D |
createIntersection(java.awt.geom.Rectangle2D r)
Returns a new Rectangle2D object representing
the intersection of this Rectangle2D with the
specified Rectangle2D. |
java.awt.geom.Rectangle2D |
createUnion(java.awt.geom.Rectangle2D r)
Returns a new Rectangle2D object representing
the union of this Rectangle2D with the
specified Rectangle2D. |
int |
distance(int x,
int y)
Return the distance of a point to this rectangle. |
int |
distance(RLPoint p)
|
int |
distance(RLRectangle r)
|
boolean |
equals(java.lang.Object o)
|
java.awt.geom.Rectangle2D |
getBounds2D()
Returns the high precision bounding box of this Rectangle2D. |
double |
getHeight()
|
double |
getWidth()
|
double |
getX()
|
double |
getY()
|
int |
hashCode()
|
boolean |
isEmpty()
Determines whether or not this Rectangle2D
is empty. |
int |
outcode(double x,
double y)
Determines where the specified double coordinates lie with respect to this Rectangle2D. |
java.util.Set<RLPoint> |
perimeter()
|
RLPoint |
point()
|
java.util.Set<RLPoint> |
points()
|
void |
setRect(double x,
double y,
double width,
double height)
Throws an UnsupportedOperationException because this class is immutable. |
RLDimension |
size()
|
java.lang.String |
toString()
Returns the String representation of this
Rectangle2D. |
| Methods inherited from class java.awt.geom.Rectangle2D |
|---|
add, add, add, contains, contains, getPathIterator, getPathIterator, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union |
| Methods inherited from class java.awt.geom.RectangularShape |
|---|
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final int x
public final int y
public final int width
public final int height
| Constructor Detail |
|---|
public RLRectangle(int x,
int y,
int wid,
int hgt)
| Method Detail |
|---|
public int distance(int x,
int y)
public int distance(RLPoint p)
public int distance(RLRectangle r)
public java.util.Set<RLPoint> points()
public java.util.Set<RLPoint> perimeter()
public double getX()
getX in class java.awt.geom.RectangularShapepublic double getY()
getY in class java.awt.geom.RectangularShapepublic double getHeight()
getHeight in class java.awt.geom.RectangularShapepublic double getWidth()
getWidth in class java.awt.geom.RectangularShapepublic RLPoint point()
public RLDimension size()
public boolean equals(java.lang.Object o)
equals in class java.awt.geom.Rectangle2Dpublic int hashCode()
hashCode in class java.awt.geom.Rectangle2D
public void setRect(double x,
double y,
double width,
double height)
setRect in class java.awt.geom.Rectangle2Dpublic boolean isEmpty()
Rectangle2D
is empty.
isEmpty in class java.awt.geom.RectangularShapetrue if this Rectangle2D
is empty; false otherwise.
public int outcode(double x,
double y)
Rectangle2D.
This method computes a binary OR of the appropriate mask values
indicating, for each side of this Rectangle2D,
whether or not the specified coordinates are on the same side
of the edge as the rest of this Rectangle2D.
outcode in class java.awt.geom.Rectangle2Dx, y - the specified coordinates
Rectangle2D.OUT_LEFT,
Rectangle2D.OUT_TOP,
Rectangle2D.OUT_RIGHT,
Rectangle2D.OUT_BOTTOMpublic java.awt.geom.Rectangle2D getBounds2D()
Rectangle2D.
getBounds2D in interface java.awt.ShapegetBounds2D in class java.awt.geom.Rectangle2DRectangle2D.public java.awt.geom.Rectangle2D createIntersection(java.awt.geom.Rectangle2D r)
Rectangle2D object representing
the intersection of this Rectangle2D with the
specified Rectangle2D.
createIntersection in class java.awt.geom.Rectangle2Dr - the Rectangle2D to be intersected
with this Rectangle2D
Rectangle2D contained in
both the specified Rectangle2D and in this
Rectangle2D.public java.awt.geom.Rectangle2D createUnion(java.awt.geom.Rectangle2D r)
Rectangle2D object representing
the union of this Rectangle2D with the
specified Rectangle2D.
createUnion in class java.awt.geom.Rectangle2Dr - the Rectangle2D to be combined with
this Rectangle2D
Rectangle2D containing
both the specified Rectangle2D and this
Rectangle2D.public java.lang.String toString()
String representation of this
Rectangle2D.
toString in class java.lang.ObjectString representing this
Rectangle2D.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||