Class PAreaBD<S>
java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaBD<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaBDType<S>,AreaValuesBDType,AreaSizeValuesBDType
public final class PAreaBD<S> extends java.lang.Object implements PAreaBDType<S>
An area with BigDecimal 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 classPAreaBD.Builder<S>Builds instances of typePAreaBD. -
Method Summary
Modifier and Type Method Description static <S> PAreaBD.Builder<S>builder()Creates a builder forPAreaBD.static <S> PAreaBD<S>copyOf(PAreaBDType<S> instance)Creates an immutable copy of aPAreaBDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaBDthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.java.math.BigDecimalheight()Deprecated.java.math.BigDecimalmaximumX()java.math.BigDecimalmaximumY()java.math.BigDecimalminimumX()java.math.BigDecimalminimumY()static <S> PAreaBD<S>of(java.math.BigDecimal minimumX, java.math.BigDecimal maximumX, java.math.BigDecimal minimumY, java.math.BigDecimal maximumY)Construct a new immutablePAreaBDinstance.java.lang.StringtoString()Prints the immutable valuePAreaBDwith attribute values.java.math.BigDecimalwidth()Deprecated.PAreaBD<S>withMaximumX(java.math.BigDecimal value)Copy the current immutable object by setting a value for themaximumXattribute.PAreaBD<S>withMaximumY(java.math.BigDecimal value)Copy the current immutable object by setting a value for themaximumYattribute.PAreaBD<S>withMinimumX(java.math.BigDecimal value)Copy the current immutable object by setting a value for theminimumXattribute.PAreaBD<S>withMinimumY(java.math.BigDecimal 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.AreaValuesBDType
sizeX, sizeYMethods inherited from interface com.io7m.jregions.core.parameterized.areas.PAreaBDType
checkPreconditions
-
Method Details
-
width
@Deprecated public java.math.BigDecimal width()Deprecated.- Specified by:
widthin interfaceAreaSizeValuesBDType- Returns:
- The width of the area
-
height
@Deprecated public java.math.BigDecimal height()Deprecated.- Specified by:
heightin interfaceAreaSizeValuesBDType- Returns:
- The height of the area
-
minimumX
public java.math.BigDecimal minimumX()- Specified by:
minimumXin interfaceAreaValuesBDType- Specified by:
minimumXin interfacePAreaBDType<S>- Returns:
- The value of the
minimumXattribute
-
maximumX
public java.math.BigDecimal maximumX()- Specified by:
maximumXin interfaceAreaValuesBDType- Specified by:
maximumXin interfacePAreaBDType<S>- Returns:
- The value of the
maximumXattribute
-
minimumY
public java.math.BigDecimal minimumY()- Specified by:
minimumYin interfaceAreaValuesBDType- Specified by:
minimumYin interfacePAreaBDType<S>- Returns:
- The value of the
minimumYattribute
-
maximumY
public java.math.BigDecimal maximumY()- Specified by:
maximumYin interfaceAreaValuesBDType- Specified by:
maximumYin interfacePAreaBDType<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 ofPAreaBDthat 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 valuePAreaBDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static <S> PAreaBD<S> of(java.math.BigDecimal minimumX, java.math.BigDecimal maximumX, java.math.BigDecimal minimumY, java.math.BigDecimal maximumY)Construct a new immutablePAreaBDinstance.- 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 PAreaBD instance
-
copyOf
Creates an immutable copy of aPAreaBDTypevalue. 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 PAreaBD instance
-
builder
Creates a builder forPAreaBD.PAreaBD.<S>builder() .setMinimumX(java.math.BigDecimal) // requiredminimumX.setMaximumX(java.math.BigDecimal) // requiredmaximumX.setMinimumY(java.math.BigDecimal) // requiredminimumY.setMaximumY(java.math.BigDecimal) // requiredmaximumY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaBD builder
-