java.lang.Object
com.io7m.jregions.core.unparameterized.areas.AreaD
All Implemented Interfaces:
AreaDType, AreaValuesDType, AreaSizeValuesDType

public final class AreaD
extends java.lang.Object
implements AreaDType

An area with double 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 axis.

  • Nested Class Summary

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

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

    checkPreconditions

    Methods inherited from interface com.io7m.jregions.core.unparameterized.areas.AreaValuesDType

    sizeX, sizeY
  • 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
    • minimumX

      public double minimumX()
      Specified by:
      minimumX in interface AreaDType
      Specified by:
      minimumX in interface AreaValuesDType
      Returns:
      The value of the minimumX attribute
    • maximumX

      public double maximumX()
      Specified by:
      maximumX in interface AreaDType
      Specified by:
      maximumX in interface AreaValuesDType
      Returns:
      The value of the maximumX attribute
    • minimumY

      public double minimumY()
      Specified by:
      minimumY in interface AreaDType
      Specified by:
      minimumY in interface AreaValuesDType
      Returns:
      The value of the minimumY attribute
    • maximumY

      public double maximumY()
      Specified by:
      maximumY in interface AreaDType
      Specified by:
      maximumY in interface AreaValuesDType
      Returns:
      The value of the maximumY attribute
    • withMinimumX

      public final AreaD withMinimumX​(double value)
      Copy the current immutable object by setting a value for the minimumX attribute. A value strict bits equality 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 AreaD withMaximumX​(double value)
      Copy the current immutable object by setting a value for the maximumX attribute. A value strict bits equality 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 AreaD withMinimumY​(double value)
      Copy the current immutable object by setting a value for the minimumY attribute. A value strict bits equality 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 AreaD withMaximumY​(double value)
      Copy the current immutable object by setting a value for the maximumY attribute. A value strict bits equality 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
    • equals

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

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

      public static AreaD of​(double minimumX, double maximumX, double minimumY, double maximumY)
      Construct a new immutable AreaD 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
      Returns:
      An immutable AreaD instance
    • copyOf

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

      public static AreaD.Builder builder()
      Creates a builder for AreaD.
       AreaD.builder()
          .setMinimumX(double) // required minimumX
          .setMaximumX(double) // required maximumX
          .setMinimumY(double) // required minimumY
          .setMaximumY(double) // required maximumY
          .build();
       
      Returns:
      A new AreaD builder