Class VolumeI
java.lang.Object
com.io7m.jregions.core.unparameterized.volumes.VolumeI
- All Implemented Interfaces:
VolumeSizeValuesIType
,VolumeIType
,VolumeValuesIType
A volume with int
coordinates.
The coordinates of the area are given in half-closed form. That is,
minimumX()
refers to the minimum inclusive value on the X
axis, and maximumX()
refers to the maximum exclusive value on
the X axis. Likewise for the Y and Z axes.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic VolumeI.Builder
builder()
Creates a builder forVolumeI
.static VolumeI
copyOf
(VolumeIType instance) Creates an immutable copy of aVolumeIType
value.boolean
This instance is equal to all instances ofVolumeI
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
,minimumZ
,maximumZ
.int
maximumX()
int
maximumY()
int
maximumZ()
int
minimumX()
int
minimumY()
int
minimumZ()
static VolumeI
of
(int minimumX, int maximumX, int minimumY, int maximumY, int minimumZ, int maximumZ) Construct a new immutableVolumeI
instance.toString()
Prints the immutable valueVolumeI
with attribute values.final VolumeI
withMaximumX
(int value) Copy the current immutable object by setting a value for themaximumX
attribute.final VolumeI
withMaximumY
(int value) Copy the current immutable object by setting a value for themaximumY
attribute.final VolumeI
withMaximumZ
(int value) Copy the current immutable object by setting a value for themaximumZ
attribute.final VolumeI
withMinimumX
(int value) Copy the current immutable object by setting a value for theminimumX
attribute.final VolumeI
withMinimumY
(int value) Copy the current immutable object by setting a value for theminimumY
attribute.final VolumeI
withMinimumZ
(int value) Copy the current immutable object by setting a value for theminimumZ
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.io7m.jregions.core.unparameterized.volumes.VolumeIType
checkPreconditions
Methods inherited from interface com.io7m.jregions.core.unparameterized.volumes.VolumeValuesIType
sizeX, sizeY, sizeZ
-
Method Details
-
minimumX
public int minimumX()- Specified by:
minimumX
in interfaceVolumeIType
- Specified by:
minimumX
in interfaceVolumeValuesIType
- Returns:
- The value of the
minimumX
attribute
-
maximumX
public int maximumX()- Specified by:
maximumX
in interfaceVolumeIType
- Specified by:
maximumX
in interfaceVolumeValuesIType
- Returns:
- The value of the
maximumX
attribute
-
minimumY
public int minimumY()- Specified by:
minimumY
in interfaceVolumeIType
- Specified by:
minimumY
in interfaceVolumeValuesIType
- Returns:
- The value of the
minimumY
attribute
-
maximumY
public int maximumY()- Specified by:
maximumY
in interfaceVolumeIType
- Specified by:
maximumY
in interfaceVolumeValuesIType
- Returns:
- The value of the
maximumY
attribute
-
minimumZ
public int minimumZ()- Specified by:
minimumZ
in interfaceVolumeIType
- Specified by:
minimumZ
in interfaceVolumeValuesIType
- Returns:
- The value of the
minimumZ
attribute
-
maximumZ
public int maximumZ()- Specified by:
maximumZ
in interfaceVolumeIType
- Specified by:
maximumZ
in interfaceVolumeValuesIType
- Returns:
- The value of the
maximumZ
attribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumX
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for minimumX- Returns:
- A modified copy of the
this
object
-
withMaximumX
Copy the current immutable object by setting a value for themaximumX
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumX- Returns:
- A modified copy of the
this
object
-
withMinimumY
Copy the current immutable object by setting a value for theminimumY
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for minimumY- Returns:
- A modified copy of the
this
object
-
withMaximumY
Copy the current immutable object by setting a value for themaximumY
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumY- Returns:
- A modified copy of the
this
object
-
withMinimumZ
Copy the current immutable object by setting a value for theminimumZ
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for minimumZ- Returns:
- A modified copy of the
this
object
-
withMaximumZ
Copy the current immutable object by setting a value for themaximumZ
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumZ- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofVolumeI
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
,minimumZ
,maximumZ
. -
toString
Prints the immutable valueVolumeI
with attribute values. -
of
public static VolumeI of(int minimumX, int maximumX, int minimumY, int maximumY, int minimumZ, int maximumZ) Construct a new immutableVolumeI
instance.- Parameters:
minimumX
- The value for theminimumX
attributemaximumX
- The value for themaximumX
attributeminimumY
- The value for theminimumY
attributemaximumY
- The value for themaximumY
attributeminimumZ
- The value for theminimumZ
attributemaximumZ
- The value for themaximumZ
attribute- Returns:
- An immutable VolumeI instance
-
copyOf
Creates an immutable copy of aVolumeIType
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable VolumeI instance
-
builder
Creates a builder forVolumeI
.VolumeI.builder() .setMinimumX(int) // required
minimumX
.setMaximumX(int) // requiredmaximumX
.setMinimumY(int) // requiredminimumY
.setMaximumY(int) // requiredmaximumY
.setMinimumZ(int) // requiredminimumZ
.setMaximumZ(int) // requiredmaximumZ
.build();- Returns:
- A new VolumeI builder
-