java.lang.Object
com.io7m.jregions.core.parameterized.volumes.PVolumeF<S>
Type Parameters:
S - A phantom type parameter indicating the coordinate space of the volume
All Implemented Interfaces:
PVolumeFType<S>, VolumeSizeValuesFType, VolumeValuesFType

public final class PVolumeF<S> extends Object implements PVolumeFType<S>

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.

  • Method Details

    • minimumX

      public float minimumX()
      Specified by:
      minimumX in interface PVolumeFType<S>
      Specified by:
      minimumX in interface VolumeValuesFType
      Returns:
      The value of the minimumX attribute
    • maximumX

      public float maximumX()
      Specified by:
      maximumX in interface PVolumeFType<S>
      Specified by:
      maximumX in interface VolumeValuesFType
      Returns:
      The value of the maximumX attribute
    • minimumY

      public float minimumY()
      Specified by:
      minimumY in interface PVolumeFType<S>
      Specified by:
      minimumY in interface VolumeValuesFType
      Returns:
      The value of the minimumY attribute
    • maximumY

      public float maximumY()
      Specified by:
      maximumY in interface PVolumeFType<S>
      Specified by:
      maximumY in interface VolumeValuesFType
      Returns:
      The value of the maximumY attribute
    • minimumZ

      public float minimumZ()
      Specified by:
      minimumZ in interface PVolumeFType<S>
      Specified by:
      minimumZ in interface VolumeValuesFType
      Returns:
      The value of the minimumZ attribute
    • maximumZ

      public float maximumZ()
      Specified by:
      maximumZ in interface PVolumeFType<S>
      Specified by:
      maximumZ in interface VolumeValuesFType
      Returns:
      The value of the maximumZ attribute
    • withMinimumX

      public final PVolumeF<S> 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 PVolumeF<S> 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 PVolumeF<S> 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 PVolumeF<S> 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 PVolumeF<S> 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 PVolumeF<S> 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(Object another)
      This instance is equal to all instances of PVolumeF that have equal attribute values.
      Overrides:
      equals in class 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 Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value PVolumeF with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static <S> PVolumeF<S> of(float minimumX, float maximumX, float minimumY, float maximumY, float minimumZ, float maximumZ)
      Construct a new immutable PVolumeF instance.
      Type Parameters:
      S - generic parameter S
      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 PVolumeF instance
    • copyOf

      public static <S> PVolumeF<S> copyOf(PVolumeFType<S> instance)
      Creates an immutable copy of a PVolumeFType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      S - generic parameter S
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable PVolumeF instance
    • builder

      public static <S> PVolumeF.Builder<S> builder()
      Creates a builder for PVolumeF.
       PVolumeF.&lt;S&gt;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();
       
      Type Parameters:
      S - generic parameter S
      Returns:
      A new PVolumeF builder