public class Rectangle
extends java.lang.Object
Constructor | Description |
---|---|
Rectangle(double x,
double y,
double width,
double height,
Length.Units unit) |
Construct
Rectangle object from values and a common unit. |
Rectangle(Length x,
Length y,
Length width,
Length height) |
Construct
Rectangle object from individual values |
Modifier and Type | Method | Description |
---|---|---|
boolean |
contains(Rectangle other) |
Determines whether another rectangle is non-strictly inscribed into the present rectangle.
|
boolean |
equals(java.lang.Object obj) |
|
static Rectangle |
fromEdges(Length left,
Length bottom,
Length right,
Length top) |
|
Length |
getBottom() |
Gets the bottom coordinate of the rectangle as
Length object. |
Length |
getLeft() |
Gets the left coordinate of the rectangle as
Length object. |
Point |
getPosition() |
Get the position (origin) of the rectangle as
Point object. |
Length |
getRight() |
Gets the right coordinate of the rectangle as
Length object. |
Size |
getSize() |
Get the size of the rectangle as
Size object. |
Length |
getTop() |
Gets the top coordinate of the rectangle as
Length object. |
int |
hashCode() |
|
static Rectangle |
parse(java.lang.String value) |
Create a
Rectangle object from a string representation. |
java.lang.String |
toString() |
Creates a string representation as x-y-width-height-tuple with associated suitable metric units, "m", "cm" or "mm".
|
java.lang.String |
toString(Length.Units unit) |
Creates a string representation as x-y-width-height-tuple with the specified unit.
|
public Rectangle(Length x, Length y, Length width, Length height)
Rectangle
object from individual valuespublic Rectangle(double x, double y, double width, double height, Length.Units unit)
Rectangle
object from values and a common unit.x
- as numerical valuey
- as numerical valuewidth
- as numerical valueheight
- as numerical valueunit
- the unitpublic static Rectangle parse(java.lang.String value)
Rectangle
object from a string representation.value
- Allowed are value-unit pairs of the form "<x_value><x_unit> <y_value><y_unit> <right_value><right_unit> <height_value><height_unit>". Example: "12.3cm 23.4mm 34.5mm 45.6mm"public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Length.Units unit)
public boolean contains(Rectangle other)
other
- as Rectangle
objectpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object