Class PVolumeBD<S>

java.lang.Object
com.io7m.jregions.core.parameterized.volumes.PVolumeBD<S>
Type Parameters:
S - A phantom type parameter indicating the coordinate space of the volume
All Implemented Interfaces:
PVolumeBDType<S>, VolumeSizeValuesBDType, VolumeValuesBDType

public final class PVolumeBD<S>
extends java.lang.Object
implements PVolumeBDType<S>

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.

  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  PVolumeBD.Builder<S>
    Builds instances of type PVolumeBD.
  • Method Summary

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

    checkPreconditions

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

    sizeX, sizeY, sizeZ
  • Method Details

    • minimumX

      public java.math.BigDecimal minimumX()
      Specified by:
      minimumX in interface PVolumeBDType<S>
      Specified by:
      minimumX in interface VolumeValuesBDType
      Returns:
      The value of the minimumX attribute
    • maximumX

      public java.math.BigDecimal maximumX()
      Specified by:
      maximumX in interface PVolumeBDType<S>
      Specified by:
      maximumX in interface VolumeValuesBDType
      Returns:
      The value of the maximumX attribute
    • minimumY

      public java.math.BigDecimal minimumY()
      Specified by:
      minimumY in interface PVolumeBDType<S>
      Specified by:
      minimumY in interface VolumeValuesBDType
      Returns:
      The value of the minimumY attribute
    • maximumY

      public java.math.BigDecimal maximumY()
      Specified by:
      maximumY in interface PVolumeBDType<S>
      Specified by:
      maximumY in interface VolumeValuesBDType
      Returns:
      The value of the maximumY attribute
    • minimumZ

      public java.math.BigDecimal minimumZ()
      Specified by:
      minimumZ in interface PVolumeBDType<S>
      Specified by:
      minimumZ in interface VolumeValuesBDType
      Returns:
      The value of the minimumZ attribute
    • maximumZ

      public java.math.BigDecimal maximumZ()
      Specified by:
      maximumZ in interface PVolumeBDType<S>
      Specified by:
      maximumZ in interface VolumeValuesBDType
      Returns:
      The value of the maximumZ attribute
    • withMinimumX

      public final PVolumeBD<S> withMinimumX​(java.math.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 PVolumeBD<S> withMaximumX​(java.math.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 PVolumeBD<S> withMinimumY​(java.math.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 PVolumeBD<S> withMaximumY​(java.math.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 PVolumeBD<S> withMinimumZ​(java.math.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 PVolumeBD<S> withMaximumZ​(java.math.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​(java.lang.Object another)
      This instance is equal to all instances of PVolumeBD 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 PVolumeBD with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • of

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

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

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