Record Class PointRange3D
java.lang.Object
java.lang.Record
dev.wyck.misc.PointRange3D
@NullMarked
@AsOf("0.0.1")
public record PointRange3D(int minX, int maxX, int minY, int maxY, int minZ, int maxZ)
extends Record
Represents a 3D range of points defined by minimum and maximum coordinates in each axis (X, Y, Z).
This class is a record, which is an immutable data carrier.
- Since:
- 0.0.1
-
Constructor Summary
ConstructorsConstructorDescriptionPointRange3D(int minX, int maxX, int minY, int maxY, int minZ, int maxZ) Creates an instance of aPointRange3Drecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getMaxLocation(World world) Returns the maximum location within the range.getMinLocation(World world) Returns the minimum location within the range.final inthashCode()Returns a hash code value for this object.intmaxX()Returns the value of themaxXrecord component.intmaxY()Returns the value of themaxYrecord component.intmaxZ()Returns the value of themaxZrecord component.intminX()Returns the value of theminXrecord component.intminY()Returns the value of theminYrecord component.intminZ()Returns the value of theminZrecord component.static PointRange3DCreates a new PointRange3D object based on two given locations.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PointRange3D
public PointRange3D(int minX, int maxX, int minY, int maxY, int minZ, int maxZ) Creates an instance of aPointRange3Drecord class.- Parameters:
minX- the value for theminXrecord componentmaxX- the value for themaxXrecord componentminY- the value for theminYrecord componentmaxY- the value for themaxYrecord componentminZ- the value for theminZrecord componentmaxZ- the value for themaxZrecord component
-
-
Method Details
-
of
Creates a new PointRange3D object based on two given locations. The minimum and maximum coordinates are calculated for each axis based on the provided locations.- Parameters:
from- The first location.to- The second location.- Returns:
- A new PointRange3D object.
- Since:
- 0.0.1
-
getMinLocation
-
getMaxLocation
-
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. -
minX
public int minX()Returns the value of theminXrecord component.- Returns:
- the value of the
minXrecord component
-
maxX
public int maxX()Returns the value of themaxXrecord component.- Returns:
- the value of the
maxXrecord component
-
minY
public int minY()Returns the value of theminYrecord component.- Returns:
- the value of the
minYrecord component
-
maxY
public int maxY()Returns the value of themaxYrecord component.- Returns:
- the value of the
maxYrecord component
-
minZ
public int minZ()Returns the value of theminZrecord component.- Returns:
- the value of the
minZrecord component
-
maxZ
public int maxZ()Returns the value of themaxZrecord component.- Returns:
- the value of the
maxZrecord component
-