Class PAreaXYSplitI<S,T extends PAreaIType<S>>
java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaXYSplitI<S,T>
- Type Parameters:
S
- A phantom type parameter indicating the coordinate space of the areaT
- The precise type of area
- All Implemented Interfaces:
PAreaXYSplitIType<S,
T>
public final class PAreaXYSplitI<S,T extends PAreaIType<S>>
extends Object
implements PAreaXYSplitIType<S,T>
An area that has been split into quadrants via an X and Y axis.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
PAreaXYSplitI.Builder<S,
T extends PAreaIType<S>> Builds instances of typePAreaXYSplitI
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S,
T extends PAreaIType<S>>
PAreaXYSplitI.Builder<S,T> builder()
Creates a builder forPAreaXYSplitI
.static <S,
T extends PAreaIType<S>>
PAreaXYSplitI<S,T> copyOf
(PAreaXYSplitIType<S, T> instance) Creates an immutable copy of aPAreaXYSplitIType
value.boolean
This instance is equal to all instances ofPAreaXYSplitI
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:x0y0
,x1y0
,x0y1
,x1y1
.static <S,
T extends PAreaIType<S>>
PAreaXYSplitI<S,T> of
(T x0y0, T x1y0, T x0y1, T x1y1) Construct a new immutablePAreaXYSplitI
instance.toString()
Prints the immutable valuePAreaXYSplitI
with attribute values.final PAreaXYSplitI<S,
T> Copy the current immutable object by setting a value for thex0y0
attribute.final PAreaXYSplitI<S,
T> Copy the current immutable object by setting a value for thex0y1
attribute.final PAreaXYSplitI<S,
T> Copy the current immutable object by setting a value for thex1y0
attribute.final PAreaXYSplitI<S,
T> Copy the current immutable object by setting a value for thex1y1
attribute.x0y0()
x0y1()
x1y0()
x1y1()
-
Method Details
-
x0y0
- Specified by:
x0y0
in interfacePAreaXYSplitIType<S,
T extends PAreaIType<S>> - Returns:
- The minimum X, minimum Y quadrant
-
x1y0
- Specified by:
x1y0
in interfacePAreaXYSplitIType<S,
T extends PAreaIType<S>> - Returns:
- The maximum X, minimum Y quadrant
-
x0y1
- Specified by:
x0y1
in interfacePAreaXYSplitIType<S,
T extends PAreaIType<S>> - Returns:
- The minimum X, maximum Y quadrant
-
x1y1
- Specified by:
x1y1
in interfacePAreaXYSplitIType<S,
T extends PAreaIType<S>> - Returns:
- The maximum X, maximum Y quadrant
-
withX0y0
Copy the current immutable object by setting a value for thex0y0
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for x0y0- Returns:
- A modified copy of the
this
object
-
withX1y0
Copy the current immutable object by setting a value for thex1y0
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for x1y0- Returns:
- A modified copy of the
this
object
-
withX0y1
Copy the current immutable object by setting a value for thex0y1
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for x0y1- Returns:
- A modified copy of the
this
object
-
withX1y1
Copy the current immutable object by setting a value for thex1y1
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for x1y1- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofPAreaXYSplitI
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:x0y0
,x1y0
,x0y1
,x1y1
. -
toString
Prints the immutable valuePAreaXYSplitI
with attribute values. -
of
Construct a new immutablePAreaXYSplitI
instance.- Type Parameters:
S
- generic parameter ST
- generic parameter T- Parameters:
x0y0
- The value for thex0y0
attributex1y0
- The value for thex1y0
attributex0y1
- The value for thex0y1
attributex1y1
- The value for thex1y1
attribute- Returns:
- An immutable PAreaXYSplitI instance
-
copyOf
public static <S,T extends PAreaIType<S>> PAreaXYSplitI<S,T> copyOf(PAreaXYSplitIType<S, T> instance) Creates an immutable copy of aPAreaXYSplitIType
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 ST
- generic parameter T- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable PAreaXYSplitI instance
-
builder
Creates a builder forPAreaXYSplitI
.PAreaXYSplitI.<S, T>builder() .setX0y0(T) // required
x0y0
.setX1y0(T) // requiredx1y0
.setX0y1(T) // requiredx0y1
.setX1y1(T) // requiredx1y1
.build();- Type Parameters:
S
- generic parameter ST
- generic parameter T- Returns:
- A new PAreaXYSplitI builder
-