public class Rectangle extends Object
Represents rectangle.
| Constructor and Description |
|---|
Rectangle() |
Rectangle(float x,
float y,
float width,
float height)
Initializes a new instance of the
Rectangle class. |
Rectangle(Rectangle rectangle)
Initializes a new instance of
Rectangle class. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Determines whether the specified rectangle is equal to the current
rectangle.
|
static boolean |
equals(Rectangle obj1,
Rectangle obj2) |
float |
getHeight()
Gets or sets the height.
|
float |
getWidth()
Gets or sets the width.
|
float |
getX()
Gets or sets the x.
|
float |
getY()
Gets or sets the y.
|
int |
hashCode()
Serves as the default hash function.
|
static boolean |
opEquality(Rectangle left,
Rectangle right)
Compares two Rectangle objects.
|
static boolean |
opInequality(Rectangle left,
Rectangle right)
Compares two Rectangle objects.
|
void |
setHeight(float value)
Gets or sets the height.
|
void |
setWidth(float value)
Gets or sets the width.
|
void |
setX(float value)
Gets or sets the x.
|
void |
setY(float value)
Gets or sets the y.
|
String |
toString() |
public Rectangle()
public Rectangle(float x,
float y,
float width,
float height)
Initializes a new instance of the Rectangle class.
x - The x.y - The y.width - The width.height - The height.public boolean equals(Object obj)
Determines whether the specified rectangle is equal to the current rectangle.
public final float getHeight()
Gets or sets the height.
Value: The height.public final float getWidth()
Gets or sets the width.
Value: The width.public final float getX()
Gets or sets the x.
Value: The x.public final float getY()
Gets or sets the y.
Value: The y.public int hashCode()
Serves as the default hash function.
public static boolean opEquality(Rectangle left, Rectangle right)
Compares two Rectangle objects. The result specifies whether the values of the Rectangle.X, Rectangle.Y, Rectangle.Width and Rectangle.Height properties of the two Rectangle objects are equal.
left - A Rectangle to compare.right - A Rectangle to compare.public static boolean opInequality(Rectangle left, Rectangle right)
Compares two Rectangle objects. The result specifies whether the values of the Rectangle.X, Rectangle.Y, Rectangle.Width and Rectangle.Height properties of the two Rectangle objects are not equal.
left - A Rectangle to compare.right - A Rectangle to compare.public final void setHeight(float value)
Gets or sets the height.
Value: The height.value - public final void setWidth(float value)
Gets or sets the width.
Value: The width.value - public final void setX(float value)
Gets or sets the x.
Value: The x.value - public final void setY(float value)
Gets or sets the y.
Value: The y.value - Copyright © 2024. All rights reserved.