public final class RectLocation
extends java.lang.Object
LineLocation
values indicating the
location of each point dimension relative to the corresponding rectangle edge.
For this purpose, the rectangle edges are interpreted as directed line segments
starting at the minimum coordinate and ending at the maximum coordinate.Modifier and Type | Field and Description |
---|---|
LineLocation |
edgeX
The relative location of the point along the x-coordinate.
|
LineLocation |
edgeY
The relative location of the point along the y-coordinate.
|
Constructor and Description |
---|
RectLocation(LineLocation edgeX,
LineLocation edgeY)
Creates a
RectLocation with the specified dimensional locations. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares the specified
Object to this RectLocation instance. |
int |
hashCode()
Returns a hash code for the
RectLocation . |
java.lang.String |
toString()
Returns a
String representation of the RectLocation . |
public final LineLocation edgeX
LineLocation
of the point relative to the rectangle’s top
(or bottom) edge, shifted to the point’s y-coordinate. Never null
,
LineLocation.LEFT
, or LineLocation.RIGHT
.public final LineLocation edgeY
LineLocation
of the point relative to the rectangle’s left
(or right) edge, shifted to the point’s x-coordinate. Never null
,
LineLocation.LEFT
, or LineLocation.RIGHT
.public RectLocation(LineLocation edgeX, LineLocation edgeY)
RectLocation
with the specified dimensional locations.edgeX
- the relative location of the point along the x-coordinateedgeY
- the relative location of the point along the y-coordinatejava.lang.NullPointerException
- if edgeX
or edgeY
is null
java.lang.IllegalArgumentException
- if edgeX
or edgeY
is
LineLocation.LEFT
or LineLocation.RIGHT
public boolean equals(java.lang.Object obj)
Object
to this RectLocation
instance.equals
in class java.lang.Object
obj
- the Object
to compare to this instancetrue
if obj
is not null
and a RectLocation
instance whose edgeX
and edgeY
values equal those
of this instance, else false
public int hashCode()
RectLocation
.hashCode
in class java.lang.Object
Integer
hash code for the RectLocation
public java.lang.String toString()
String
representation of the RectLocation
.