Class PAreaD<S>
java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaD<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaDType<S>,AreaValuesDType,AreaSizeValuesDType
public final class PAreaD<S> extends java.lang.Object implements PAreaDType<S>
An area with double 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 classPAreaD.Builder<S>Builds instances of typePAreaD. -
Method Summary
Modifier and Type Method Description static <S> PAreaD.Builder<S>builder()Creates a builder forPAreaD.static <S> PAreaD<S>copyOf(PAreaDType<S> instance)Creates an immutable copy of aPAreaDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaDthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.doubleheight()Deprecated.doublemaximumX()doublemaximumY()doubleminimumX()doubleminimumY()static <S> PAreaD<S>of(double minimumX, double maximumX, double minimumY, double maximumY)Construct a new immutablePAreaDinstance.java.lang.StringtoString()Prints the immutable valuePAreaDwith attribute values.doublewidth()Deprecated.PAreaD<S>withMaximumX(double value)Copy the current immutable object by setting a value for themaximumXattribute.PAreaD<S>withMaximumY(double value)Copy the current immutable object by setting a value for themaximumYattribute.PAreaD<S>withMinimumX(double value)Copy the current immutable object by setting a value for theminimumXattribute.PAreaD<S>withMinimumY(double 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.AreaValuesDType
sizeX, sizeYMethods inherited from interface com.io7m.jregions.core.parameterized.areas.PAreaDType
checkPreconditions
-
Method Details
-
width
@Deprecated public double width()Deprecated.- Specified by:
widthin interfaceAreaSizeValuesDType- Returns:
- The width of the area
-
height
@Deprecated public double height()Deprecated.- Specified by:
heightin interfaceAreaSizeValuesDType- Returns:
- The height of the area
-
minimumX
public double minimumX()- Specified by:
minimumXin interfaceAreaValuesDType- Specified by:
minimumXin interfacePAreaDType<S>- Returns:
- The value of the
minimumXattribute
-
maximumX
public double maximumX()- Specified by:
maximumXin interfaceAreaValuesDType- Specified by:
maximumXin interfacePAreaDType<S>- Returns:
- The value of the
maximumXattribute
-
minimumY
public double minimumY()- Specified by:
minimumYin interfaceAreaValuesDType- Specified by:
minimumYin interfacePAreaDType<S>- Returns:
- The value of the
minimumYattribute
-
maximumY
public double maximumY()- Specified by:
maximumYin interfaceAreaValuesDType- Specified by:
maximumYin interfacePAreaDType<S>- Returns:
- The value of the
maximumYattribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumXattribute. A value strict bits equality 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. A value strict bits equality 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. A value strict bits equality 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. A value strict bits equality 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 ofPAreaDthat 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 valuePAreaDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePAreaDinstance.- 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 PAreaD instance
-
copyOf
Creates an immutable copy of aPAreaDTypevalue. 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 PAreaD instance
-
builder
Creates a builder forPAreaD.PAreaD.<S>builder() .setMinimumX(double) // requiredminimumX.setMaximumX(double) // requiredmaximumX.setMinimumY(double) // requiredminimumY.setMaximumY(double) // requiredmaximumY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaD builder
-