Class PVolumeSizeF<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PVolumeSizeF<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the volume
- All Implemented Interfaces:
PVolumeSizeFType<S>,VolumeSizeValuesFType
public final class PVolumeSizeF<S> extends java.lang.Object implements PVolumeSizeFType<S>
The size of a volume with
float coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPVolumeSizeF.Builder<S>Builds instances of typePVolumeSizeF. -
Method Summary
Modifier and Type Method Description static <S> PVolumeSizeF.Builder<S>builder()Creates a builder forPVolumeSizeF.static <S> PVolumeSizeF<S>copyOf(PVolumeSizeFType<S> instance)Creates an immutable copy of aPVolumeSizeFTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPVolumeSizeFthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY,sizeZ.static <S> PVolumeSizeF<S>of(float sizeX, float sizeY, float sizeZ)Construct a new immutablePVolumeSizeFinstance.floatsizeX()floatsizeY()floatsizeZ()java.lang.StringtoString()Prints the immutable valuePVolumeSizeFwith attribute values.PVolumeSizeF<S>withSizeX(float value)Copy the current immutable object by setting a value for thesizeXattribute.PVolumeSizeF<S>withSizeY(float value)Copy the current immutable object by setting a value for thesizeYattribute.PVolumeSizeF<S>withSizeZ(float value)Copy the current immutable object by setting a value for thesizeZattribute.
-
Method Details
-
sizeX
public float sizeX()- Specified by:
sizeXin interfacePVolumeSizeFType<S>- Specified by:
sizeXin interfaceVolumeSizeValuesFType- Returns:
- The value of the
sizeXattribute
-
sizeY
public float sizeY()- Specified by:
sizeYin interfacePVolumeSizeFType<S>- Specified by:
sizeYin interfaceVolumeSizeValuesFType- Returns:
- The value of the
sizeYattribute
-
sizeZ
public float sizeZ()- Specified by:
sizeZin interfacePVolumeSizeFType<S>- Specified by:
sizeZin interfaceVolumeSizeValuesFType- 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 ofPVolumeSizeFthat 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 valuePVolumeSizeFwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePVolumeSizeFinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattributesizeZ- The value for thesizeZattribute- Returns:
- An immutable PVolumeSizeF instance
-
copyOf
Creates an immutable copy of aPVolumeSizeFTypevalue. 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 PVolumeSizeF instance
-
builder
Creates a builder forPVolumeSizeF.PVolumeSizeF.<S>builder() .setSizeX(float) // requiredsizeX.setSizeY(float) // requiredsizeY.setSizeZ(float) // requiredsizeZ.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PVolumeSizeF builder
-