Record Class Bounds
java.lang.Object
java.lang.Record
org.openpatch.scratch.Bounds
- Record Components:
x- the smallest xy- the smallest ywidth- the widthheight- the height
A rectangle along the axes: the bounds of a shape.
-
Constructor Summary
ConstructorsConstructorDescriptionBounds(double x, double y, double width, double height) Creates an instance of aBoundsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleheight()Returns the value of theheightrecord component.booleanintersects(Bounds other) final StringtoString()Returns a string representation of this record class.doublewidth()Returns the value of thewidthrecord component.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.
-
Constructor Details
-
Bounds
public Bounds(double x, double y, double width, double height) Creates an instance of aBoundsrecord class.
-
-
Method Details
-
intersects
- Parameters:
other- another rectangle- Returns:
- whether the two overlap with some area; rectangles that only touch do not
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
x
-
y
-
width
-
height
-