Record Class Rectangle.Immutable
java.lang.Object
java.lang.Record
codechicken.lib.gui.modular.lib.geometry.Rectangle.Immutable
- All Implemented Interfaces:
Rectangle
- Enclosing interface:
- Rectangle
public static record Rectangle.Immutable(Position position, double xSize, double ySize)
extends Record
implements Rectangle
Should not be created directly
-
Nested Class Summary
Nested classes/interfaces inherited from interface codechicken.lib.gui.modular.lib.geometry.Rectangle
Rectangle.Dynamic, Rectangle.Immutable, Rectangle.Mutable -
Constructor Summary
Constructors -
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()pos()position()Returns the value of thepositionrecord component.toString()Returns a string representation of this record class.doublewidth()doublexSize()Returns the value of thexSizerecord component.doubleySize()Returns the value of theySizerecord component.
-
Constructor Details
-
Immutable
Creates an instance of aImmutablerecord class.- Parameters:
position- the value for thepositionrecord componentxSize- the value for thexSizerecord componentySize- the value for theySizerecord component
-
-
Method Details
-
pos
-
width
public double width() -
height
public double height() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
xSize
public double xSize()Returns the value of thexSizerecord component.- Returns:
- the value of the
xSizerecord component
-
ySize
public double ySize()Returns the value of theySizerecord component.- Returns:
- the value of the
ySizerecord component
-