java.lang.Object
com.io7m.jregions.core.unparameterized.areas.AreaBI
All Implemented Interfaces:
AreaBIType, AreaValuesBIType, AreaSizeValuesBIType

public final class AreaBI
extends java.lang.Object
implements AreaBIType

An area with BigInteger 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  AreaBI.Builder
    Builds instances of type AreaBI.
  • Method Summary

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

    checkPreconditions

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

    sizeX, sizeY
  • Method Details

    • width

      @Deprecated public java.math.BigInteger width()
      Deprecated.
      Specified by:
      width in interface AreaSizeValuesBIType
      Returns:
      The width of the area
    • height

      @Deprecated public java.math.BigInteger height()
      Deprecated.
      Specified by:
      height in interface AreaSizeValuesBIType
      Returns:
      The height of the area
    • minimumX

      public java.math.BigInteger minimumX()
      Specified by:
      minimumX in interface AreaBIType
      Specified by:
      minimumX in interface AreaValuesBIType
      Returns:
      The value of the minimumX attribute
    • maximumX

      public java.math.BigInteger maximumX()
      Specified by:
      maximumX in interface AreaBIType
      Specified by:
      maximumX in interface AreaValuesBIType
      Returns:
      The value of the maximumX attribute
    • minimumY

      public java.math.BigInteger minimumY()
      Specified by:
      minimumY in interface AreaBIType
      Specified by:
      minimumY in interface AreaValuesBIType
      Returns:
      The value of the minimumY attribute
    • maximumY

      public java.math.BigInteger maximumY()
      Specified by:
      maximumY in interface AreaBIType
      Specified by:
      maximumY in interface AreaValuesBIType
      Returns:
      The value of the maximumY attribute
    • withMinimumX

      public final AreaBI withMinimumX​(java.math.BigInteger 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 AreaBI withMaximumX​(java.math.BigInteger 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 AreaBI withMinimumY​(java.math.BigInteger 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 AreaBI withMaximumY​(java.math.BigInteger 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
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of AreaBI 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 AreaBI with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • of

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

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

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