Class PAreaSizeBI<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PAreaSizeBI<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaSizeBIType<S>,AreaSizeValuesBIType
public final class PAreaSizeBI<S> extends java.lang.Object implements PAreaSizeBIType<S>
The size of an area with
BigInteger coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPAreaSizeBI.Builder<S>Builds instances of typePAreaSizeBI. -
Method Summary
Modifier and Type Method Description static <S> PAreaSizeBI.Builder<S>builder()Creates a builder forPAreaSizeBI.static <S> PAreaSizeBI<S>copyOf(PAreaSizeBIType<S> instance)Creates an immutable copy of aPAreaSizeBITypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaSizeBIthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY.java.math.BigIntegerheight()Deprecated.UsesizeY()static <S> PAreaSizeBI<S>of(java.math.BigInteger sizeX, java.math.BigInteger sizeY)Construct a new immutablePAreaSizeBIinstance.java.math.BigIntegersizeX()java.math.BigIntegersizeY()java.lang.StringtoString()Prints the immutable valuePAreaSizeBIwith attribute values.java.math.BigIntegerwidth()Deprecated.UsesizeX()PAreaSizeBI<S>withSizeX(java.math.BigInteger value)Copy the current immutable object by setting a value for thesizeXattribute.PAreaSizeBI<S>withSizeY(java.math.BigInteger value)Copy the current immutable object by setting a value for thesizeYattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jregions.core.parameterized.sizes.PAreaSizeBIType
checkPreconditions
-
Method Details
-
width
@Deprecated public java.math.BigInteger width()Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesBIType- Returns:
- The width of the area
-
height
@Deprecated public java.math.BigInteger height()Deprecated.UsesizeY()- Specified by:
heightin interfaceAreaSizeValuesBIType- Returns:
- The height of the area
-
sizeX
public java.math.BigInteger sizeX()- Specified by:
sizeXin interfaceAreaSizeValuesBIType- Specified by:
sizeXin interfacePAreaSizeBIType<S>- Returns:
- The value of the
sizeXattribute
-
sizeY
public java.math.BigInteger sizeY()- Specified by:
sizeYin interfaceAreaSizeValuesBIType- Specified by:
sizeYin interfacePAreaSizeBIType<S>- Returns:
- The value of the
sizeYattribute
-
withSizeX
Copy the current immutable object by setting a value for thesizeXattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeX- Returns:
- A modified copy of the
thisobject
-
withSizeY
Copy the current immutable object by setting a value for thesizeYattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeY- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofPAreaSizeBIthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:sizeX,sizeY.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valuePAreaSizeBIwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePAreaSizeBIinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattribute- Returns:
- An immutable PAreaSizeBI instance
-
copyOf
Creates an immutable copy of aPAreaSizeBITypevalue. 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 PAreaSizeBI instance
-
builder
Creates a builder forPAreaSizeBI.PAreaSizeBI.<S>builder() .setSizeX(java.math.BigInteger) // requiredsizeX.setSizeY(java.math.BigInteger) // requiredsizeY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaSizeBI builder
-