@ValidCoordinates @NotNegativeCoordinates public final class RectangularBox extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
int |
getBottom() |
int |
getLeft() |
int |
getRight() |
int |
getTop() |
int |
hashCode() |
static RectangularBox |
newInstance(int bottom,
int left,
int top,
int right)
static factory method.
|
static RectangularBox |
newInstanceFromPoints(Point bottomLeft,
Point topRight)
static factory method creating a new instance of the
RectangularBox from two points. |
void |
rotate(Rotation desiredRotation)
rotates this
RectangularBox using the given rotation. |
String |
toString() |
public int getBottom()
public int getLeft()
public int getTop()
public int getRight()
public void rotate(Rotation desiredRotation)
RectangularBox using the given rotation. This method is null safe.desiredRotation - public static RectangularBox newInstance(int bottom, int left, int top, int right)
bottom - left - top - right - IllegalArgumentException - if one of the arguments is negative, top is lower then bottom or right is lower then left.public static RectangularBox newInstanceFromPoints(Point bottomLeft, Point topRight)
RectangularBox from two points.bottomLeft - topRight - newInstance(int, int, int, int)Copyright © 2015. All Rights Reserved.