Class PVolumeSizeF<S>

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

public final class PVolumeSizeF<S>
extends java.lang.Object
implements PVolumeSizeFType<S>
The size of a volume with float coordinates.
  • Nested Class Summary

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

    Modifier and Type Method Description
    static <S> PVolumeSizeF.Builder<S> builder()
    Creates a builder for PVolumeSizeF.
    static <S> PVolumeSizeF<S> copyOf​(PVolumeSizeFType<S> instance)
    Creates an immutable copy of a PVolumeSizeFType value.
    boolean equals​(java.lang.Object another)
    This instance is equal to all instances of PVolumeSizeF that have equal attribute values.
    int hashCode()
    Computes a hash code from attributes: sizeX, sizeY, sizeZ.
    static <S> PVolumeSizeF<S> of​(float sizeX, float sizeY, float sizeZ)
    Construct a new immutable PVolumeSizeF instance.
    float sizeX()  
    float sizeY()  
    float sizeZ()  
    java.lang.String toString()
    Prints the immutable value PVolumeSizeF with attribute values.
    PVolumeSizeF<S> withSizeX​(float value)
    Copy the current immutable object by setting a value for the sizeX attribute.
    PVolumeSizeF<S> withSizeY​(float value)
    Copy the current immutable object by setting a value for the sizeY attribute.
    PVolumeSizeF<S> withSizeZ​(float value)
    Copy the current immutable object by setting a value for the sizeZ attribute.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • sizeX

      public float sizeX()
      Specified by:
      sizeX in interface PVolumeSizeFType<S>
      Specified by:
      sizeX in interface VolumeSizeValuesFType
      Returns:
      The value of the sizeX attribute
    • sizeY

      public float sizeY()
      Specified by:
      sizeY in interface PVolumeSizeFType<S>
      Specified by:
      sizeY in interface VolumeSizeValuesFType
      Returns:
      The value of the sizeY attribute
    • sizeZ

      public float sizeZ()
      Specified by:
      sizeZ in interface PVolumeSizeFType<S>
      Specified by:
      sizeZ in interface VolumeSizeValuesFType
      Returns:
      The value of the sizeZ attribute
    • withSizeX

      public final PVolumeSizeF<S> withSizeX​(float value)
      Copy the current immutable object by setting a value for the sizeX attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sizeX
      Returns:
      A modified copy of the this object
    • withSizeY

      public final PVolumeSizeF<S> withSizeY​(float value)
      Copy the current immutable object by setting a value for the sizeY attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sizeY
      Returns:
      A modified copy of the this object
    • withSizeZ

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

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of PVolumeSizeF 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: sizeX, sizeY, sizeZ.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

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

      public static <S> PVolumeSizeF<S> of​(float sizeX, float sizeY, float sizeZ)
      Construct a new immutable PVolumeSizeF instance.
      Type Parameters:
      S - generic parameter S
      Parameters:
      sizeX - The value for the sizeX attribute
      sizeY - The value for the sizeY attribute
      sizeZ - The value for the sizeZ attribute
      Returns:
      An immutable PVolumeSizeF instance
    • copyOf

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

      public static <S> PVolumeSizeF.Builder<S> builder()
      Creates a builder for PVolumeSizeF.
       PVolumeSizeF.&lt;S&gt;builder()
          .setSizeX(float) // required sizeX
          .setSizeY(float) // required sizeY
          .setSizeZ(float) // required sizeZ
          .build();
       
      Type Parameters:
      S - generic parameter S
      Returns:
      A new PVolumeSizeF builder