Record Class TableBounds
java.lang.Object
java.lang.Record
org.comp2059.pong.model.TableBounds
Immutable edges of the table's play area.
-
Constructor Summary
ConstructorsConstructorDescriptionTableBounds(int left, int right, int top, int bottom) Creates an instance of aTableBoundsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbottom()Returns the value of thebottomrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intleft()Returns the value of theleftrecord component.intright()Returns the value of therightrecord component.inttop()Returns the value of thetoprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TableBounds
public TableBounds(int left, int right, int top, int bottom) Creates an instance of aTableBoundsrecord class.- Parameters:
left- the value for theleftrecord componentright- the value for therightrecord componenttop- the value for thetoprecord componentbottom- the value for thebottomrecord 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. -
left
public int left()Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
public int right()Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
top
public int top()Returns the value of thetoprecord component.- Returns:
- the value of the
toprecord component
-
bottom
public int bottom()Returns the value of thebottomrecord component.- Returns:
- the value of the
bottomrecord component
-