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 java.lang.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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPAreaBI.Builder<S>Builds instances of typePAreaBI. -
Method Summary
Modifier and Type Method Description static <S> PAreaBI.Builder<S>builder()Creates a builder forPAreaBI.static <S> PAreaBI<S>copyOf(PAreaBIType<S> instance)Creates an immutable copy of aPAreaBITypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaBIthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.java.math.BigIntegerheight()Deprecated.java.math.BigIntegermaximumX()java.math.BigIntegermaximumY()java.math.BigIntegerminimumX()java.math.BigIntegerminimumY()static <S> PAreaBI<S>of(java.math.BigInteger minimumX, java.math.BigInteger maximumX, java.math.BigInteger minimumY, java.math.BigInteger maximumY)Construct a new immutablePAreaBIinstance.java.lang.StringtoString()Prints the immutable valuePAreaBIwith attribute values.java.math.BigIntegerwidth()Deprecated.PAreaBI<S>withMaximumX(java.math.BigInteger value)Copy the current immutable object by setting a value for themaximumXattribute.PAreaBI<S>withMaximumY(java.math.BigInteger value)Copy the current immutable object by setting a value for themaximumYattribute.PAreaBI<S>withMinimumX(java.math.BigInteger value)Copy the current immutable object by setting a value for theminimumXattribute.PAreaBI<S>withMinimumY(java.math.BigInteger value)Copy the current immutable object by setting a value for theminimumYattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jregions.core.unparameterized.areas.AreaValuesBIType
sizeX, sizeYMethods inherited from interface com.io7m.jregions.core.parameterized.areas.PAreaBIType
checkPreconditions
-
Method Details
-
width
@Deprecated public java.math.BigInteger width()Deprecated.- Specified by:
widthin interfaceAreaSizeValuesBIType- Returns:
- The width of the area
-
height
@Deprecated public java.math.BigInteger height()Deprecated.- Specified by:
heightin interfaceAreaSizeValuesBIType- Returns:
- The height of the area
-
minimumX
public java.math.BigInteger minimumX()- Specified by:
minimumXin interfaceAreaValuesBIType- Specified by:
minimumXin interfacePAreaBIType<S>- Returns:
- The value of the
minimumXattribute
-
maximumX
public java.math.BigInteger maximumX()- Specified by:
maximumXin interfaceAreaValuesBIType- Specified by:
maximumXin interfacePAreaBIType<S>- Returns:
- The value of the
maximumXattribute
-
minimumY
public java.math.BigInteger minimumY()- Specified by:
minimumYin interfaceAreaValuesBIType- Specified by:
minimumYin interfacePAreaBIType<S>- Returns:
- The value of the
minimumYattribute
-
maximumY
public java.math.BigInteger maximumY()- Specified by:
maximumYin interfaceAreaValuesBIType- Specified by:
maximumYin interfacePAreaBIType<S>- Returns:
- The value of the
maximumYattribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumXattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumX- Returns:
- A modified copy of the
thisobject
-
withMaximumX
Copy the current immutable object by setting a value for themaximumXattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for maximumX- Returns:
- A modified copy of the
thisobject
-
withMinimumY
Copy the current immutable object by setting a value for theminimumYattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumY- Returns:
- A modified copy of the
thisobject
-
withMaximumY
Copy the current immutable object by setting a value for themaximumYattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for maximumY- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofPAreaBIthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valuePAreaBIwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static <S> PAreaBI<S> of(java.math.BigInteger minimumX, java.math.BigInteger maximumX, java.math.BigInteger minimumY, java.math.BigInteger maximumY)Construct a new immutablePAreaBIinstance.- Type Parameters:
S- generic parameter S- Parameters:
minimumX- The value for theminimumXattributemaximumX- The value for themaximumXattributeminimumY- The value for theminimumYattributemaximumY- The value for themaximumYattribute- Returns:
- An immutable PAreaBI instance
-
copyOf
Creates an immutable copy of aPAreaBITypevalue. 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
Creates a builder forPAreaBI.PAreaBI.<S>builder() .setMinimumX(java.math.BigInteger) // requiredminimumX.setMaximumX(java.math.BigInteger) // requiredmaximumX.setMinimumY(java.math.BigInteger) // requiredminimumY.setMaximumY(java.math.BigInteger) // requiredmaximumY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaBI builder
-