Class PVolumeSizeD<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PVolumeSizeD<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the volume
- All Implemented Interfaces:
PVolumeSizeDType<S>,VolumeSizeValuesDType
public final class PVolumeSizeD<S> extends java.lang.Object implements PVolumeSizeDType<S>
The size of a volume with
double coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPVolumeSizeD.Builder<S>Builds instances of typePVolumeSizeD. -
Method Summary
Modifier and Type Method Description static <S> PVolumeSizeD.Builder<S>builder()Creates a builder forPVolumeSizeD.static <S> PVolumeSizeD<S>copyOf(PVolumeSizeDType<S> instance)Creates an immutable copy of aPVolumeSizeDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPVolumeSizeDthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY,sizeZ.static <S> PVolumeSizeD<S>of(double sizeX, double sizeY, double sizeZ)Construct a new immutablePVolumeSizeDinstance.doublesizeX()doublesizeY()doublesizeZ()java.lang.StringtoString()Prints the immutable valuePVolumeSizeDwith attribute values.PVolumeSizeD<S>withSizeX(double value)Copy the current immutable object by setting a value for thesizeXattribute.PVolumeSizeD<S>withSizeY(double value)Copy the current immutable object by setting a value for thesizeYattribute.PVolumeSizeD<S>withSizeZ(double value)Copy the current immutable object by setting a value for thesizeZattribute.
-
Method Details
-
sizeX
public double sizeX()- Specified by:
sizeXin interfacePVolumeSizeDType<S>- Specified by:
sizeXin interfaceVolumeSizeValuesDType- Returns:
- The value of the
sizeXattribute
-
sizeY
public double sizeY()- Specified by:
sizeYin interfacePVolumeSizeDType<S>- Specified by:
sizeYin interfaceVolumeSizeValuesDType- Returns:
- The value of the
sizeYattribute
-
sizeZ
public double sizeZ()- Specified by:
sizeZin interfacePVolumeSizeDType<S>- Specified by:
sizeZin interfaceVolumeSizeValuesDType- Returns:
- The value of the
sizeZattribute
-
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
-
withSizeZ
Copy the current immutable object by setting a value for thesizeZattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeZ- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofPVolumeSizeDthat 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,sizeZ.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valuePVolumeSizeDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePVolumeSizeDinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattributesizeZ- The value for thesizeZattribute- Returns:
- An immutable PVolumeSizeD instance
-
copyOf
Creates an immutable copy of aPVolumeSizeDTypevalue. 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 PVolumeSizeD instance
-
builder
Creates a builder forPVolumeSizeD.PVolumeSizeD.<S>builder() .setSizeX(double) // requiredsizeX.setSizeY(double) // requiredsizeY.setSizeZ(double) // requiredsizeZ.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PVolumeSizeD builder
-