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 class  VolumeF.Builder
    Builds instances of type VolumeF.
  • Method Summary

    Modifier and Type Method Description
    static VolumeF.Builder builder()
    Creates a builder for VolumeF.
    static VolumeF copyOf​(VolumeFType instance)
    Creates an immutable copy of a VolumeFType value.
    boolean equals​(java.lang.Object another)
    This instance is equal to all instances of VolumeF that have equal attribute values.
    int hashCode()
    Computes a hash code from attributes: minimumX, maximumX, minimumY, maximumY, minimumZ, maximumZ.
    float maximumX()  
    float maximumY()  
    float maximumZ()  
    float minimumX()  
    float minimumY()  
    float minimumZ()  
    static VolumeF of​(float minimumX, float maximumX, float minimumY, float maximumY, float minimumZ, float maximumZ)
    Construct a new immutable VolumeF instance.
    java.lang.String toString()
    Prints the immutable value VolumeF with attribute values.
    VolumeF withMaximumX​(float value)
    Copy the current immutable object by setting a value for the maximumX attribute.
    VolumeF withMaximumY​(float value)
    Copy the current immutable object by setting a value for the maximumY attribute.
    VolumeF withMaximumZ​(float value)
    Copy the current immutable object by setting a value for the maximumZ attribute.
    VolumeF withMinimumX​(float value)
    Copy the current immutable object by setting a value for the minimumX attribute.
    VolumeF withMinimumY​(float value)
    Copy the current immutable object by setting a value for the minimumY attribute.
    VolumeF withMinimumZ​(float value)
    Copy the current immutable object by setting a value for the minimumZ 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.VolumeFType

    checkPreconditions

    Methods inherited from interface com.io7m.jregions.core.unparameterized.volumes.VolumeValuesFType

    sizeX, sizeY, sizeZ
  • Method Details

    • minimumX

      public float minimumX()
      Specified by:
      minimumX in interface VolumeFType
      Specified by:
      minimumX in interface VolumeValuesFType
      Returns:
      The value of the minimumX attribute
    • maximumX

      public float maximumX()
      Specified by:
      maximumX in interface VolumeFType
      Specified by:
      maximumX in interface VolumeValuesFType
      Returns:
      The value of the maximumX attribute
    • minimumY

      public float minimumY()
      Specified by:
      minimumY in interface VolumeFType
      Specified by:
      minimumY in interface VolumeValuesFType
      Returns:
      The value of the minimumY attribute
    • maximumY

      public float maximumY()
      Specified by:
      maximumY in interface VolumeFType
      Specified by:
      maximumY in interface VolumeValuesFType
      Returns:
      The value of the maximumY attribute
    • minimumZ

      public float minimumZ()
      Specified by:
      minimumZ in interface VolumeFType
      Specified by:
      minimumZ in interface VolumeValuesFType
      Returns:
      The value of the minimumZ attribute
    • maximumZ

      public float maximumZ()
      Specified by:
      maximumZ in interface VolumeFType
      Specified by:
      maximumZ in interface VolumeValuesFType
      Returns:
      The value of the maximumZ attribute
    • withMinimumX

      public final VolumeF withMinimumX​(float value)
      Copy the current immutable object by setting a value for the minimumX attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minimumX
      Returns:
      A modified copy of the this object
    • withMaximumX

      public final VolumeF withMaximumX​(float value)
      Copy the current immutable object by setting a value for the maximumX attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maximumX
      Returns:
      A modified copy of the this object
    • withMinimumY

      public final VolumeF withMinimumY​(float value)
      Copy the current immutable object by setting a value for the minimumY attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minimumY
      Returns:
      A modified copy of the this object
    • withMaximumY

      public final VolumeF withMaximumY​(float value)
      Copy the current immutable object by setting a value for the maximumY attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maximumY
      Returns:
      A modified copy of the this object
    • withMinimumZ

      public final VolumeF withMinimumZ​(float value)
      Copy the current immutable object by setting a value for the minimumZ attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minimumZ
      Returns:
      A modified copy of the this object
    • withMaximumZ

      public final VolumeF withMaximumZ​(float value)
      Copy the current immutable object by setting a value for the maximumZ attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maximumZ
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of VolumeF that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: minimumX, maximumX, minimumY, maximumY, minimumZ, maximumZ.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value VolumeF with attribute values.
      Overrides:
      toString in class java.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 immutable VolumeF instance.
      Parameters:
      minimumX - The value for the minimumX attribute
      maximumX - The value for the maximumX attribute
      minimumY - The value for the minimumY attribute
      maximumY - The value for the maximumY attribute
      minimumZ - The value for the minimumZ attribute
      maximumZ - The value for the maximumZ attribute
      Returns:
      An immutable VolumeF instance
    • copyOf

      public static VolumeF copyOf​(VolumeFType instance)
      Creates an immutable copy of a VolumeFType 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 VolumeF instance
    • builder

      public static VolumeF.Builder builder()
      Creates a builder for VolumeF.
       VolumeF.builder()
          .setMinimumX(float) // required minimumX
          .setMaximumX(float) // required maximumX
          .setMinimumY(float) // required minimumY
          .setMaximumY(float) // required maximumY
          .setMinimumZ(float) // required minimumZ
          .setMaximumZ(float) // required maximumZ
          .build();
       
      Returns:
      A new VolumeF builder