java.lang.Object
com.io7m.jregions.core.unparameterized.volumes.VolumeBD
All Implemented Interfaces:
VolumeSizeValuesBDType, VolumeBDType, VolumeValuesBDType

public final class VolumeBD extends Object implements VolumeBDType

A volume with BigDecimal 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 BigDecimal minimumX()
      Specified by:
      minimumX in interface VolumeBDType
      Specified by:
      minimumX in interface VolumeValuesBDType
      Returns:
      The value of the minimumX attribute
    • maximumX

      public BigDecimal maximumX()
      Specified by:
      maximumX in interface VolumeBDType
      Specified by:
      maximumX in interface VolumeValuesBDType
      Returns:
      The value of the maximumX attribute
    • minimumY

      public BigDecimal minimumY()
      Specified by:
      minimumY in interface VolumeBDType
      Specified by:
      minimumY in interface VolumeValuesBDType
      Returns:
      The value of the minimumY attribute
    • maximumY

      public BigDecimal maximumY()
      Specified by:
      maximumY in interface VolumeBDType
      Specified by:
      maximumY in interface VolumeValuesBDType
      Returns:
      The value of the maximumY attribute
    • minimumZ

      public BigDecimal minimumZ()
      Specified by:
      minimumZ in interface VolumeBDType
      Specified by:
      minimumZ in interface VolumeValuesBDType
      Returns:
      The value of the minimumZ attribute
    • maximumZ

      public BigDecimal maximumZ()
      Specified by:
      maximumZ in interface VolumeBDType
      Specified by:
      maximumZ in interface VolumeValuesBDType
      Returns:
      The value of the maximumZ attribute
    • withMinimumX

      public final VolumeBD withMinimumX(BigDecimal value)
      Copy the current immutable object by setting a value for the minimumX attribute. An equals check 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 VolumeBD withMaximumX(BigDecimal value)
      Copy the current immutable object by setting a value for the maximumX attribute. An equals check 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 VolumeBD withMinimumY(BigDecimal value)
      Copy the current immutable object by setting a value for the minimumY attribute. An equals check 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 VolumeBD withMaximumY(BigDecimal value)
      Copy the current immutable object by setting a value for the maximumY attribute. An equals check 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 VolumeBD withMinimumZ(BigDecimal value)
      Copy the current immutable object by setting a value for the minimumZ attribute. An equals check 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 VolumeBD withMaximumZ(BigDecimal value)
      Copy the current immutable object by setting a value for the maximumZ attribute. An equals check 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 VolumeBD 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 VolumeBD with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static VolumeBD of(BigDecimal minimumX, BigDecimal maximumX, BigDecimal minimumY, BigDecimal maximumY, BigDecimal minimumZ, BigDecimal maximumZ)
      Construct a new immutable VolumeBD 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 VolumeBD instance
    • copyOf

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

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