Class PAreaBI<S>

java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaBI<S>
Type Parameters:
S - A phantom type parameter indicating the coordinate space of the area
All Implemented Interfaces:
PAreaBIType<S>, AreaValuesBIType, AreaSizeValuesBIType

public final class PAreaBI<S> extends Object implements PAreaBIType<S>

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.

  • Method Details

    • width

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

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

      public BigInteger minimumX()
      Specified by:
      minimumX in interface AreaValuesBIType
      Specified by:
      minimumX in interface PAreaBIType<S>
      Returns:
      The value of the minimumX attribute
    • maximumX

      public BigInteger maximumX()
      Specified by:
      maximumX in interface AreaValuesBIType
      Specified by:
      maximumX in interface PAreaBIType<S>
      Returns:
      The value of the maximumX attribute
    • minimumY

      public BigInteger minimumY()
      Specified by:
      minimumY in interface AreaValuesBIType
      Specified by:
      minimumY in interface PAreaBIType<S>
      Returns:
      The value of the minimumY attribute
    • maximumY

      public BigInteger maximumY()
      Specified by:
      maximumY in interface AreaValuesBIType
      Specified by:
      maximumY in interface PAreaBIType<S>
      Returns:
      The value of the maximumY attribute
    • withMinimumX

      public final PAreaBI<S> withMinimumX(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 PAreaBI<S> withMaximumX(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 PAreaBI<S> withMinimumY(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 PAreaBI<S> withMaximumY(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(Object another)
      This instance is equal to all instances of PAreaBI 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: minimumX, maximumX, minimumY, maximumY.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static <S> PAreaBI<S> of(BigInteger minimumX, BigInteger maximumX, BigInteger minimumY, BigInteger maximumY)
      Construct a new immutable PAreaBI instance.
      Type Parameters:
      S - generic parameter S
      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 PAreaBI instance
    • copyOf

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

      public static <S> PAreaBI.Builder<S> builder()
      Creates a builder for PAreaBI.
       PAreaBI.&lt;S&gt;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();
       
      Type Parameters:
      S - generic parameter S
      Returns:
      A new PAreaBI builder