Class PAreaSizeI<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PAreaSizeI<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaSizeIType<S>,AreaSizeValuesIType
The size of an area with
int coordinates.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <S> PAreaSizeI.Builder<S>builder()Creates a builder forPAreaSizeI.static <S> PAreaSizeI<S>copyOf(PAreaSizeIType<S> instance) Creates an immutable copy of aPAreaSizeITypevalue.booleanThis instance is equal to all instances ofPAreaSizeIthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY.intheight()Deprecated.static <S> PAreaSizeI<S>of(int sizeX, int sizeY) Construct a new immutablePAreaSizeIinstance.intsizeX()intsizeY()toString()Prints the immutable valuePAreaSizeIwith attribute values.intwidth()Deprecated.UsesizeX()final PAreaSizeI<S>withSizeX(int value) Copy the current immutable object by setting a value for thesizeXattribute.final PAreaSizeI<S>withSizeY(int value) Copy the current immutable object by setting a value for thesizeYattribute.
-
Method Details
-
width
Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesIType- Returns:
- The width of the area
-
height
Deprecated.UsesizeY()- Specified by:
heightin interfaceAreaSizeValuesIType- Returns:
- The height of the area
-
sizeX
public int sizeX()- Specified by:
sizeXin interfaceAreaSizeValuesIType- Specified by:
sizeXin interfacePAreaSizeIType<S>- Returns:
- The value of the
sizeXattribute
-
sizeY
public int sizeY()- Specified by:
sizeYin interfaceAreaSizeValuesIType- Specified by:
sizeYin interfacePAreaSizeIType<S>- Returns:
- The value of the
sizeYattribute
-
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
-
equals
This instance is equal to all instances ofPAreaSizeIthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:sizeX,sizeY. -
toString
Prints the immutable valuePAreaSizeIwith attribute values. -
of
Construct a new immutablePAreaSizeIinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattribute- Returns:
- An immutable PAreaSizeI instance
-
copyOf
Creates an immutable copy of aPAreaSizeITypevalue. 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 PAreaSizeI instance
-
builder
Creates a builder forPAreaSizeI.PAreaSizeI.<S>builder() .setSizeX(int) // requiredsizeX.setSizeY(int) // requiredsizeY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaSizeI builder
-
sizeY()