Record Class RectangularPrism
java.lang.Object
java.lang.Record
com.expedient.adventofcodejade.common.RectangularPrism
- Record Components:
length-width-height-
A rectangular prism
-
Constructor Summary
ConstructorsConstructorDescriptionRectangularPrism(int length, int width, int height) Creates an instance of aRectangularPrismrecord 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.intheight()Returns the value of theheightrecord component.intlength()Returns the value of thelengthrecord component.intintintfinal StringtoString()Returns a string representation of this record class.intvolume()intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
RectangularPrism
-
-
Method Details
-
surfaceArea
public int surfaceArea()- Returns:
- the total surface area of the prism
-
smallestSurfaceArea
public int smallestSurfaceArea()- Returns:
- the surface area of one of the smallest side of the prism
-
smallestPerimeter
public int smallestPerimeter()- Returns:
- the perimeter of the prism along the shortest portion
-
volume
public int volume()- Returns:
- the volume of the prism
-
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. -
length
-
width
-
height
-