Class PAreaSizeD<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PAreaSizeD<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaSizeDType<S>,AreaSizeValuesDType
The size of an area with
double coordinates.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <S> PAreaSizeD.Builder<S>builder()Creates a builder forPAreaSizeD.static <S> PAreaSizeD<S>copyOf(PAreaSizeDType<S> instance) Creates an immutable copy of aPAreaSizeDTypevalue.booleanThis instance is equal to all instances ofPAreaSizeDthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY.doubleheight()Deprecated.static <S> PAreaSizeD<S>of(double sizeX, double sizeY) Construct a new immutablePAreaSizeDinstance.doublesizeX()doublesizeY()toString()Prints the immutable valuePAreaSizeDwith attribute values.doublewidth()Deprecated.UsesizeX()final PAreaSizeD<S>withSizeX(double value) Copy the current immutable object by setting a value for thesizeXattribute.final PAreaSizeD<S>withSizeY(double 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.PAreaSizeDType
checkPreconditions
-
Method Details
-
width
Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesDType- Returns:
- The width of the area
-
height
Deprecated.UsesizeY()- Specified by:
heightin interfaceAreaSizeValuesDType- Returns:
- The height of the area
-
sizeX
public double sizeX()- Specified by:
sizeXin interfaceAreaSizeValuesDType- Specified by:
sizeXin interfacePAreaSizeDType<S>- Returns:
- The value of the
sizeXattribute
-
sizeY
public double sizeY()- Specified by:
sizeYin interfaceAreaSizeValuesDType- Specified by:
sizeYin interfacePAreaSizeDType<S>- Returns:
- The value of the
sizeYattribute
-
withSizeX
Copy the current immutable object by setting a value for thesizeXattribute. A value strict bits equality 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. A value strict bits equality 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
This instance is equal to all instances ofPAreaSizeDthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:sizeX,sizeY. -
toString
Prints the immutable valuePAreaSizeDwith attribute values. -
of
Construct a new immutablePAreaSizeDinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattribute- Returns:
- An immutable PAreaSizeD instance
-
copyOf
Creates an immutable copy of aPAreaSizeDTypevalue. 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 PAreaSizeD instance
-
builder
Creates a builder forPAreaSizeD.PAreaSizeD.<S>builder() .setSizeX(double) // requiredsizeX.setSizeY(double) // requiredsizeY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaSizeD builder
-
sizeY()