Class PVolumeSizeI<S>

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

public final class PVolumeSizeI<S> extends Object implements PVolumeSizeIType<S>
The size of a volume with int coordinates.
  • Method Details

    • sizeX

      public int sizeX()
      Specified by:
      sizeX in interface PVolumeSizeIType<S>
      Specified by:
      sizeX in interface VolumeSizeValuesIType
      Returns:
      The value of the sizeX attribute
    • sizeY

      public int sizeY()
      Specified by:
      sizeY in interface PVolumeSizeIType<S>
      Specified by:
      sizeY in interface VolumeSizeValuesIType
      Returns:
      The value of the sizeY attribute
    • sizeZ

      public int sizeZ()
      Specified by:
      sizeZ in interface PVolumeSizeIType<S>
      Specified by:
      sizeZ in interface VolumeSizeValuesIType
      Returns:
      The value of the sizeZ attribute
    • withSizeX

      public final PVolumeSizeI<S> withSizeX(int value)
      Copy the current immutable object by setting a value for the sizeX attribute. A value equality check is 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 PVolumeSizeI<S> withSizeY(int value)
      Copy the current immutable object by setting a value for the sizeY attribute. A value equality check is 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 PVolumeSizeI<S> withSizeZ(int value)
      Copy the current immutable object by setting a value for the sizeZ attribute. A value equality check is 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(Object another)
      This instance is equal to all instances of PVolumeSizeI 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: sizeX, sizeY, sizeZ.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static <S> PVolumeSizeI<S> of(int sizeX, int sizeY, int sizeZ)
      Construct a new immutable PVolumeSizeI 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 PVolumeSizeI instance
    • copyOf

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

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