Class VolumeSizeI
java.lang.Object
com.io7m.jregions.core.unparameterized.sizes.VolumeSizeI
- All Implemented Interfaces:
VolumeSizeIType,VolumeSizeValuesIType
The size of a volume with
int coordinates.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic VolumeSizeI.Builderbuilder()Creates a builder forVolumeSizeI.static VolumeSizeIcopyOf(VolumeSizeIType instance) Creates an immutable copy of aVolumeSizeITypevalue.booleanThis instance is equal to all instances ofVolumeSizeIthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY,sizeZ.static VolumeSizeIof(int sizeX, int sizeY, int sizeZ) Construct a new immutableVolumeSizeIinstance.intsizeX()intsizeY()intsizeZ()toString()Prints the immutable valueVolumeSizeIwith attribute values.final VolumeSizeIwithSizeX(int value) Copy the current immutable object by setting a value for thesizeXattribute.final VolumeSizeIwithSizeY(int value) Copy the current immutable object by setting a value for thesizeYattribute.final VolumeSizeIwithSizeZ(int value) Copy the current immutable object by setting a value for thesizeZattribute.
-
Method Details
-
sizeX
public int sizeX()- Specified by:
sizeXin interfaceVolumeSizeIType- Specified by:
sizeXin interfaceVolumeSizeValuesIType- Returns:
- The value of the
sizeXattribute
-
sizeY
public int sizeY()- Specified by:
sizeYin interfaceVolumeSizeIType- Specified by:
sizeYin interfaceVolumeSizeValuesIType- Returns:
- The value of the
sizeYattribute
-
sizeZ
public int sizeZ()- Specified by:
sizeZin interfaceVolumeSizeIType- Specified by:
sizeZin interfaceVolumeSizeValuesIType- Returns:
- The value of the
sizeZattribute
-
withSizeX
Copy the current immutable object by setting a value for thesizeXattribute. A value equality check is 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 equality check is 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 equality check is 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
This instance is equal to all instances ofVolumeSizeIthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:sizeX,sizeY,sizeZ. -
toString
Prints the immutable valueVolumeSizeIwith attribute values. -
of
Construct a new immutableVolumeSizeIinstance.- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattributesizeZ- The value for thesizeZattribute- Returns:
- An immutable VolumeSizeI instance
-
copyOf
Creates an immutable copy of aVolumeSizeITypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable VolumeSizeI instance
-
builder
Creates a builder forVolumeSizeI.VolumeSizeI.builder() .setSizeX(int) // requiredsizeX.setSizeY(int) // requiredsizeY.setSizeZ(int) // requiredsizeZ.build();- Returns:
- A new VolumeSizeI builder
-