public interface RectangleImmutable extends WriteCloneable, Comparable<RectangleImmutable>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(RectangleImmutable d)
Compares square of size 1st, if equal the square of position.
|
float |
coverage(RectangleImmutable r)
Returns the coverage of given rectangle w/ this this one, i.e.
|
boolean |
equals(Object obj)
Checks whether two rect objects are equal.
|
int |
getHeight() |
int |
getWidth() |
int |
getX() |
int |
getY() |
int |
hashCode() |
RectangleImmutable |
intersection(int rx1,
int ry1,
int rx2,
int ry2)
Returns the intersection of this rectangleand the given coordinates.
|
RectangleImmutable |
intersection(RectangleImmutable r)
Returns the intersection of this rectangleand the given rectangle.
|
RectangleImmutable |
union(int rx1,
int ry1,
int rx2,
int ry2)
Returns the union of this rectangleand the given coordinates.
|
RectangleImmutable |
union(RectangleImmutable r)
Returns the union of this rectangle and the given rectangle.
|
cloneMutable
int getHeight()
int getWidth()
int getX()
int getY()
RectangleImmutable union(RectangleImmutable r)
RectangleImmutable union(int rx1, int ry1, int rx2, int ry2)
RectangleImmutable intersection(RectangleImmutable r)
RectangleImmutable intersection(int rx1, int ry1, int rx2, int ry2)
float coverage(RectangleImmutable r)
0.0
and 1.0
.
Coverage is computed by:
isect = this.intersection(r); coverage = area( isect ) / area( this ) ;
int compareTo(RectangleImmutable d)
Compares square of size 1st, if equal the square of position.
compareTo
in interface Comparable<RectangleImmutable>
boolean equals(Object obj)
Rectangle
are equal if the four integer values
of the fields y
, x
,
height
, and width
are all equal.Copyright 2010 JogAmp Community.