Class PAreaI<S>
java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaI<S>
- Type Parameters:
S
- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaIType<S>
,AreaValuesIType
,AreaSizeValuesIType
An area with int
coordinates.
The coordinates of the area are given in half-closed form. That is,
minimumX()
refers to the minimum inclusive value on the X
axis, and maximumX()
refers to the maximum exclusive value on
the X axis. Likewise for the Y axis.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> PAreaI.Builder<S>
builder()
Creates a builder forPAreaI
.static <S> PAreaI<S>
copyOf
(PAreaIType<S> instance) Creates an immutable copy of aPAreaIType
value.boolean
This instance is equal to all instances ofPAreaI
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
.int
height()
Deprecated.int
maximumX()
int
maximumY()
int
minimumX()
int
minimumY()
static <S> PAreaI<S>
of
(int minimumX, int maximumX, int minimumY, int maximumY) Construct a new immutablePAreaI
instance.toString()
Prints the immutable valuePAreaI
with attribute values.int
width()
Deprecated.withMaximumX
(int value) Copy the current immutable object by setting a value for themaximumX
attribute.withMaximumY
(int value) Copy the current immutable object by setting a value for themaximumY
attribute.withMinimumX
(int value) Copy the current immutable object by setting a value for theminimumX
attribute.withMinimumY
(int value) Copy the current immutable object by setting a value for theminimumY
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.io7m.jregions.core.unparameterized.areas.AreaValuesIType
sizeX, sizeY
Methods inherited from interface com.io7m.jregions.core.parameterized.areas.PAreaIType
checkPreconditions
-
Method Details
-
width
Deprecated.- Specified by:
width
in interfaceAreaSizeValuesIType
- Returns:
- The width of the area
-
height
Deprecated.- Specified by:
height
in interfaceAreaSizeValuesIType
- Returns:
- The height of the area
-
minimumX
public int minimumX()- Specified by:
minimumX
in interfaceAreaValuesIType
- Specified by:
minimumX
in interfacePAreaIType<S>
- Returns:
- The value of the
minimumX
attribute
-
maximumX
public int maximumX()- Specified by:
maximumX
in interfaceAreaValuesIType
- Specified by:
maximumX
in interfacePAreaIType<S>
- Returns:
- The value of the
maximumX
attribute
-
minimumY
public int minimumY()- Specified by:
minimumY
in interfaceAreaValuesIType
- Specified by:
minimumY
in interfacePAreaIType<S>
- Returns:
- The value of the
minimumY
attribute
-
maximumY
public int maximumY()- Specified by:
maximumY
in interfaceAreaValuesIType
- Specified by:
maximumY
in interfacePAreaIType<S>
- Returns:
- The value of the
maximumY
attribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumX
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for minimumX- Returns:
- A modified copy of the
this
object
-
withMaximumX
Copy the current immutable object by setting a value for themaximumX
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumX- Returns:
- A modified copy of the
this
object
-
withMinimumY
Copy the current immutable object by setting a value for theminimumY
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for minimumY- Returns:
- A modified copy of the
this
object
-
withMaximumY
Copy the current immutable object by setting a value for themaximumY
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumY- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofPAreaI
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
. -
toString
Prints the immutable valuePAreaI
with attribute values. -
of
Construct a new immutablePAreaI
instance.- Type Parameters:
S
- generic parameter S- Parameters:
minimumX
- The value for theminimumX
attributemaximumX
- The value for themaximumX
attributeminimumY
- The value for theminimumY
attributemaximumY
- The value for themaximumY
attribute- Returns:
- An immutable PAreaI instance
-
copyOf
Creates an immutable copy of aPAreaIType
value. 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 PAreaI instance
-
builder
Creates a builder forPAreaI
.PAreaI.<S>builder() .setMinimumX(int) // required
minimumX
.setMaximumX(int) // requiredmaximumX
.setMinimumY(int) // requiredminimumY
.setMaximumY(int) // requiredmaximumY
.build();- Type Parameters:
S
- generic parameter S- Returns:
- A new PAreaI builder
-
AreaValuesIType.sizeY()