Class VolumeF
java.lang.Object
com.io7m.jregions.core.unparameterized.volumes.VolumeF
- All Implemented Interfaces:
VolumeSizeValuesFType,VolumeFType,VolumeValuesFType
public final class VolumeF extends java.lang.Object implements VolumeFType
A volume with float 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 classVolumeF.BuilderBuilds instances of typeVolumeF. -
Method Summary
Modifier and Type Method Description static VolumeF.Builderbuilder()Creates a builder forVolumeF.static VolumeFcopyOf(VolumeFType instance)Creates an immutable copy of aVolumeFTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofVolumeFthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY,minimumZ,maximumZ.floatmaximumX()floatmaximumY()floatmaximumZ()floatminimumX()floatminimumY()floatminimumZ()static VolumeFof(float minimumX, float maximumX, float minimumY, float maximumY, float minimumZ, float maximumZ)Construct a new immutableVolumeFinstance.java.lang.StringtoString()Prints the immutable valueVolumeFwith attribute values.VolumeFwithMaximumX(float value)Copy the current immutable object by setting a value for themaximumXattribute.VolumeFwithMaximumY(float value)Copy the current immutable object by setting a value for themaximumYattribute.VolumeFwithMaximumZ(float value)Copy the current immutable object by setting a value for themaximumZattribute.VolumeFwithMinimumX(float value)Copy the current immutable object by setting a value for theminimumXattribute.VolumeFwithMinimumY(float value)Copy the current immutable object by setting a value for theminimumYattribute.VolumeFwithMinimumZ(float 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.VolumeFType
checkPreconditionsMethods inherited from interface com.io7m.jregions.core.unparameterized.volumes.VolumeValuesFType
sizeX, sizeY, sizeZ
-
Method Details
-
minimumX
public float minimumX()- Specified by:
minimumXin interfaceVolumeFType- Specified by:
minimumXin interfaceVolumeValuesFType- Returns:
- The value of the
minimumXattribute
-
maximumX
public float maximumX()- Specified by:
maximumXin interfaceVolumeFType- Specified by:
maximumXin interfaceVolumeValuesFType- Returns:
- The value of the
maximumXattribute
-
minimumY
public float minimumY()- Specified by:
minimumYin interfaceVolumeFType- Specified by:
minimumYin interfaceVolumeValuesFType- Returns:
- The value of the
minimumYattribute
-
maximumY
public float maximumY()- Specified by:
maximumYin interfaceVolumeFType- Specified by:
maximumYin interfaceVolumeValuesFType- Returns:
- The value of the
maximumYattribute
-
minimumZ
public float minimumZ()- Specified by:
minimumZin interfaceVolumeFType- Specified by:
minimumZin interfaceVolumeValuesFType- Returns:
- The value of the
minimumZattribute
-
maximumZ
public float maximumZ()- Specified by:
maximumZin interfaceVolumeFType- Specified by:
maximumZin interfaceVolumeValuesFType- Returns:
- The value of the
maximumZattribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumXattribute. A value strict bits equality 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 strict bits equality 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 strict bits equality 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 strict bits equality 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 strict bits equality 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 strict bits equality 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 ofVolumeFthat 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 valueVolumeFwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static VolumeF of(float minimumX, float maximumX, float minimumY, float maximumY, float minimumZ, float maximumZ)Construct a new immutableVolumeFinstance.- 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 VolumeF instance
-
copyOf
Creates an immutable copy of aVolumeFTypevalue. 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 VolumeF instance
-
builder
Creates a builder forVolumeF.VolumeF.builder() .setMinimumX(float) // requiredminimumX.setMaximumX(float) // requiredmaximumX.setMinimumY(float) // requiredminimumY.setMaximumY(float) // requiredmaximumY.setMinimumZ(float) // requiredminimumZ.setMaximumZ(float) // requiredmaximumZ.build();- Returns:
- A new VolumeF builder
-