Class VolumeI
java.lang.Object
com.io7m.jregions.core.unparameterized.volumes.VolumeI
- All Implemented Interfaces:
VolumeSizeValuesIType,VolumeIType,VolumeValuesIType
public final class VolumeI extends java.lang.Object implements VolumeIType
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
Nested Classes Modifier and Type Class Description static classVolumeI.BuilderBuilds instances of typeVolumeI. -
Method Summary
Modifier and Type Method Description static VolumeI.Builderbuilder()Creates a builder forVolumeI.static VolumeIcopyOf(VolumeIType instance)Creates an immutable copy of aVolumeITypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofVolumeIthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY,minimumZ,maximumZ.intmaximumX()intmaximumY()intmaximumZ()intminimumX()intminimumY()intminimumZ()static VolumeIof(int minimumX, int maximumX, int minimumY, int maximumY, int minimumZ, int maximumZ)Construct a new immutableVolumeIinstance.java.lang.StringtoString()Prints the immutable valueVolumeIwith attribute values.VolumeIwithMaximumX(int value)Copy the current immutable object by setting a value for themaximumXattribute.VolumeIwithMaximumY(int value)Copy the current immutable object by setting a value for themaximumYattribute.VolumeIwithMaximumZ(int value)Copy the current immutable object by setting a value for themaximumZattribute.VolumeIwithMinimumX(int value)Copy the current immutable object by setting a value for theminimumXattribute.VolumeIwithMinimumY(int value)Copy the current immutable object by setting a value for theminimumYattribute.VolumeIwithMinimumZ(int value)Copy the current immutable object by setting a value for theminimumZattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jregions.core.unparameterized.volumes.VolumeIType
checkPreconditionsMethods inherited from interface com.io7m.jregions.core.unparameterized.volumes.VolumeValuesIType
sizeX, sizeY, sizeZ
-
Method Details
-
minimumX
public int minimumX()- Specified by:
minimumXin interfaceVolumeIType- Specified by:
minimumXin interfaceVolumeValuesIType- Returns:
- The value of the
minimumXattribute
-
maximumX
public int maximumX()- Specified by:
maximumXin interfaceVolumeIType- Specified by:
maximumXin interfaceVolumeValuesIType- Returns:
- The value of the
maximumXattribute
-
minimumY
public int minimumY()- Specified by:
minimumYin interfaceVolumeIType- Specified by:
minimumYin interfaceVolumeValuesIType- Returns:
- The value of the
minimumYattribute
-
maximumY
public int maximumY()- Specified by:
maximumYin interfaceVolumeIType- Specified by:
maximumYin interfaceVolumeValuesIType- Returns:
- The value of the
maximumYattribute
-
minimumZ
public int minimumZ()- Specified by:
minimumZin interfaceVolumeIType- Specified by:
minimumZin interfaceVolumeValuesIType- Returns:
- The value of the
minimumZattribute
-
maximumZ
public int maximumZ()- Specified by:
maximumZin interfaceVolumeIType- Specified by:
maximumZin interfaceVolumeValuesIType- Returns:
- The value of the
maximumZattribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumXattribute. 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
thisobject
-
withMaximumX
Copy the current immutable object by setting a value for themaximumXattribute. 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
thisobject
-
withMinimumY
Copy the current immutable object by setting a value for theminimumYattribute. 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
thisobject
-
withMaximumY
Copy the current immutable object by setting a value for themaximumYattribute. 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
thisobject
-
withMinimumZ
Copy the current immutable object by setting a value for theminimumZattribute. 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
thisobject
-
withMaximumZ
Copy the current immutable object by setting a value for themaximumZattribute. 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
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofVolumeIthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY,minimumZ,maximumZ.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueVolumeIwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static VolumeI of(int minimumX, int maximumX, int minimumY, int maximumY, int minimumZ, int maximumZ)Construct a new immutableVolumeIinstance.- Parameters:
minimumX- The value for theminimumXattributemaximumX- The value for themaximumXattributeminimumY- The value for theminimumYattributemaximumY- The value for themaximumYattributeminimumZ- The value for theminimumZattributemaximumZ- The value for themaximumZattribute- Returns:
- An immutable VolumeI instance
-
copyOf
Creates an immutable copy of aVolumeITypevalue. 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) // requiredminimumX.setMaximumX(int) // requiredmaximumX.setMinimumY(int) // requiredminimumY.setMaximumY(int) // requiredmaximumY.setMinimumZ(int) // requiredminimumZ.setMaximumZ(int) // requiredmaximumZ.build();- Returns:
- A new VolumeI builder
-