| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Object | |
| public Object | cloneMutable()
Implements com. |
| public int | compareTo(final RectangleImmutable
the object to be compared. d)Implements com. Compares square of size 1st, if equal the square of position. |
| public final float | coverage(final RectangleImmutable r)
Implements com. 0.0 and 1.0.
|
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. Implements com. |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public int | hashCode()
Overrides java. Implements com. |
| public final RectangleImmutable | intersection(final RectangleImmutable r)
Implements com. |
| public final RectangleImmutable | intersection(final int rx1, final int ry1, final int rx2, final int ry2)
Implements com. |
| public final Rectangle | Returns: this instance for scalingscale factor for x sx, final int scale factor for y sy)Scale this instance's components, i.e. multiply them by the given scale factors. |
| public final Rectangle | Returns: this instance for scalinginverse scale factor for x sx, final int inverse scale factor for y sy)Inverse scale this instance's components, i.e. divide them by the given scale factors. |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public String | |
| public final RectangleImmutable | union(final RectangleImmutable r)
Implements com. |
| public final RectangleImmutable | union(final int rx1, final int ry1, final int rx2, final int ry2)
Implements com. |
| public final Rectangle | Returns: this instance holding the union of given rectangles.given list of rectangles rectangles)Calculates the union of the given rectangles, stores it in this instance and returns this instance. |
| height | back to summary |
|---|---|
| pack-priv int height | |
| width | back to summary |
|---|---|
| pack-priv int width | |
| x | back to summary |
|---|---|
| pack-priv int x | |
| y | back to summary |
|---|---|
| pack-priv int y | |
| Rectangle | back to summary |
|---|---|
| public Rectangle() | |
| Rectangle | back to summary |
|---|---|
| public Rectangle(final int x, final int y, final int width, final int height) | |
| Rectangle | back to summary |
|---|---|
| public Rectangle(final RectangleImmutable s) | |
| clone | back to summary |
|---|---|
| protected Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
| cloneMutable | back to summary |
|---|---|
| public Object cloneMutable() Implements com. Doc from com. Get a mutable clone from this instance.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(final RectangleImmutable d) Implements com. Doc from com. Compares square of size 1st, if equal the square of position. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| coverage | back to summary |
|---|---|
| public final float coverage(final RectangleImmutable r) Implements com. Doc from com. Returns the coverage of given rectangle w/ this this one, i.e. between Coverage is computed by: isect = this.intersection(r); coverage = area( isect ) / area( this ) ;
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Implements com. Doc from com. Checks whether two rect objects are equal. Two instances
of
| |
| getHeight | back to summary |
|---|---|
| public final int getHeight() Implements com.
| |
| getWidth | back to summary |
|---|---|
| public final int getWidth() Implements com.
| |
| getX | back to summary |
|---|---|
| public final int getX() Implements com.
| |
| getY | back to summary |
|---|---|
| public final int getY() Implements com.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements com. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| intersection | back to summary |
|---|---|
| public final RectangleImmutable intersection(final RectangleImmutable r) Implements com. Doc from com. Returns the intersection of this rectangleand the given rectangle.
| |
| intersection | back to summary |
|---|---|
| public final RectangleImmutable intersection(final int rx1, final int ry1, final int rx2, final int ry2) Implements com. Doc from com. Returns the intersection of this rectangleand the given coordinates.
| |
| scale | back to summary |
|---|---|
| public final Rectangle scale(final int sx, final int sy) Scale this instance's components, i.e. multiply them by the given scale factors.
| |
| scaleInv | back to summary |
|---|---|
| public final Rectangle scaleInv(final int sx, final int sy) Inverse scale this instance's components, i.e. divide them by the given scale factors.
| |
| set | back to summary |
|---|---|
| public final void set(final int x, final int y, final int width, final int height) | |
| set | back to summary |
|---|---|
| public final void set(final Rectangle s) | |
| set | back to summary |
|---|---|
| public final void set(final RectangleImmutable s) | |
| setHeight | back to summary |
|---|---|
| public final void setHeight(final int height) | |
| setWidth | back to summary |
|---|---|
| public final void setWidth(final int width) | |
| setX | back to summary |
|---|---|
| public final void setX(final int x) | |
| setY | back to summary |
|---|---|
| public final void setY(final int y) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| union | back to summary |
|---|---|
| public final RectangleImmutable union(final RectangleImmutable r) Implements com. Doc from com. Returns the union of this rectangle and the given rectangle.
| |
| union | back to summary |
|---|---|
| public final RectangleImmutable union(final int rx1, final int ry1, final int rx2, final int ry2) Implements com. Doc from com. Returns the union of this rectangleand the given coordinates.
| |
| union | back to summary |
|---|---|
| public final Rectangle union(final List<RectangleImmutable> rectangles) Calculates the union of the given rectangles, stores it in this instance and returns this instance.
| |