Record Class DrawInstruction.DrawRect
java.lang.Object
java.lang.Record
com.xpdustry.nohorny.common.DrawInstruction.DrawRect
- All Implemented Interfaces:
DrawInstruction
- Enclosing interface:
DrawInstruction
public static record DrawInstruction.DrawRect(int x, int y, int w, int h)
extends Record
implements DrawInstruction
-
Nested Class Summary
Nested classes/interfaces inherited from interface DrawInstruction
DrawInstruction.DrawRect, DrawInstruction.DrawTrig, DrawInstruction.SetColor -
Constructor Summary
ConstructorsConstructorDescriptionDrawRect(int x, int y, int w, int h) Creates an instance of aDrawRectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.inth()Returns the value of thehrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intw()Returns the value of thewrecord component.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.
-
Constructor Details
-
DrawRect
public DrawRect(int x, int y, int w, int h) Creates an instance of aDrawRectrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentw- the value for thewrecord componenth- the value for thehrecord component
-
-
Method Details
-
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
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
w
public int w()Returns the value of thewrecord component.- Returns:
- the value of the
wrecord component
-
h
public int h()Returns the value of thehrecord component.- Returns:
- the value of the
hrecord component
-