java.lang.Object
com.io7m.jregions.core.unparameterized.sizes.AreaSizeD
All Implemented Interfaces:
AreaSizeDType, AreaSizeValuesDType

public final class AreaSizeD
extends java.lang.Object
implements AreaSizeDType
The size of an area with double coordinates.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  AreaSizeD.Builder
    Builds instances of type AreaSizeD.
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.io7m.jregions.core.unparameterized.sizes.AreaSizeDType

    checkPreconditions
  • Method Details

    • width

      @Deprecated public double width()
      Deprecated.
      Specified by:
      width in interface AreaSizeValuesDType
      Returns:
      The width of the area
    • height

      @Deprecated public double height()
      Deprecated.
      Specified by:
      height in interface AreaSizeValuesDType
      Returns:
      The height of the area
    • sizeX

      public double sizeX()
      Specified by:
      sizeX in interface AreaSizeDType
      Specified by:
      sizeX in interface AreaSizeValuesDType
      Returns:
      The value of the sizeX attribute
    • sizeY

      public double sizeY()
      Specified by:
      sizeY in interface AreaSizeDType
      Specified by:
      sizeY in interface AreaSizeValuesDType
      Returns:
      The value of the sizeY attribute
    • withSizeX

      public final AreaSizeD withSizeX​(double 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 AreaSizeD withSizeY​(double 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
    • equals

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

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

      public static AreaSizeD of​(double sizeX, double sizeY)
      Construct a new immutable AreaSizeD instance.
      Parameters:
      sizeX - The value for the sizeX attribute
      sizeY - The value for the sizeY attribute
      Returns:
      An immutable AreaSizeD instance
    • copyOf

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

      public static AreaSizeD.Builder builder()
      Creates a builder for AreaSizeD.
       AreaSizeD.builder()
          .setSizeX(double) // required sizeX
          .setSizeY(double) // required sizeY
          .build();
       
      Returns:
      A new AreaSizeD builder