java.lang.Object
com.io7m.jregions.core.unparameterized.areas.AreaL
All Implemented Interfaces:
AreaLType, AreaValuesLType, AreaSizeValuesLType

public final class AreaL extends Object implements AreaLType

An area with long 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 long width()
      Deprecated.
      Specified by:
      width in interface AreaSizeValuesLType
      Returns:
      The width of the area
    • height

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

      public long sizeX()
      Specified by:
      sizeX in interface AreaSizeValuesLType
      Specified by:
      sizeX in interface AreaValuesLType
      Returns:
      The computed-at-construction value of the sizeX attribute
    • sizeY

      public long sizeY()
      Specified by:
      sizeY in interface AreaSizeValuesLType
      Specified by:
      sizeY in interface AreaValuesLType
      Returns:
      The computed-at-construction value of the sizeY attribute
    • minimumX

      public long minimumX()
      Specified by:
      minimumX in interface AreaLType
      Specified by:
      minimumX in interface AreaValuesLType
      Returns:
      The value of the minimumX attribute
    • maximumX

      public long maximumX()
      Specified by:
      maximumX in interface AreaLType
      Specified by:
      maximumX in interface AreaValuesLType
      Returns:
      The value of the maximumX attribute
    • minimumY

      public long minimumY()
      Specified by:
      minimumY in interface AreaLType
      Specified by:
      minimumY in interface AreaValuesLType
      Returns:
      The value of the minimumY attribute
    • maximumY

      public long maximumY()
      Specified by:
      maximumY in interface AreaLType
      Specified by:
      maximumY in interface AreaValuesLType
      Returns:
      The value of the maximumY attribute
    • withMinimumX

      public final AreaL withMinimumX(long value)
      Copy the current immutable object by setting a value for the minimumX attribute. A value equality check is 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 AreaL withMaximumX(long value)
      Copy the current immutable object by setting a value for the maximumX attribute. A value equality check is 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 AreaL withMinimumY(long value)
      Copy the current immutable object by setting a value for the minimumY attribute. A value equality check is 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 AreaL withMaximumY(long value)
      Copy the current immutable object by setting a value for the maximumY attribute. A value equality check is 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 AreaL 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 AreaL with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static AreaL of(long minimumX, long maximumX, long minimumY, long maximumY)
      Construct a new immutable AreaL 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 AreaL instance
    • copyOf

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

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