Class PAreaXYSplitL<S,T extends PAreaLType<S>>
java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaXYSplitL<S,T>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the areaT- The precise type of area
- All Implemented Interfaces:
PAreaXYSplitLType<S,T>
public final class PAreaXYSplitL<S,T extends PAreaLType<S>> extends java.lang.Object implements PAreaXYSplitLType<S,T>
An area that has been split into quadrants via an X and Y axis.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPAreaXYSplitL.Builder<S,T extends PAreaLType<S>>Builds instances of typePAreaXYSplitL. -
Method Summary
Modifier and Type Method Description static <S, T extends PAreaLType<S>>
PAreaXYSplitL.Builder<S,T>builder()Creates a builder forPAreaXYSplitL.static <S, T extends PAreaLType<S>>
PAreaXYSplitL<S,T>copyOf(PAreaXYSplitLType<S,T> instance)Creates an immutable copy of aPAreaXYSplitLTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaXYSplitLthat have equal attribute values.inthashCode()Computes a hash code from attributes:x0y0,x1y0,x0y1,x1y1.static <S, T extends PAreaLType<S>>
PAreaXYSplitL<S,T>of(T x0y0, T x1y0, T x0y1, T x1y1)Construct a new immutablePAreaXYSplitLinstance.java.lang.StringtoString()Prints the immutable valuePAreaXYSplitLwith attribute values.PAreaXYSplitL<S,T>withX0y0(T value)Copy the current immutable object by setting a value for thex0y0attribute.PAreaXYSplitL<S,T>withX0y1(T value)Copy the current immutable object by setting a value for thex0y1attribute.PAreaXYSplitL<S,T>withX1y0(T value)Copy the current immutable object by setting a value for thex1y0attribute.PAreaXYSplitL<S,T>withX1y1(T value)Copy the current immutable object by setting a value for thex1y1attribute.Tx0y0()Tx0y1()Tx1y0()Tx1y1()
-
Method Details
-
x0y0
- Specified by:
x0y0in interfacePAreaXYSplitLType<S,T extends PAreaLType<S>>- Returns:
- The minimum X, minimum Y quadrant
-
x1y0
- Specified by:
x1y0in interfacePAreaXYSplitLType<S,T extends PAreaLType<S>>- Returns:
- The maximum X, minimum Y quadrant
-
x0y1
- Specified by:
x0y1in interfacePAreaXYSplitLType<S,T extends PAreaLType<S>>- Returns:
- The minimum X, maximum Y quadrant
-
x1y1
- Specified by:
x1y1in interfacePAreaXYSplitLType<S,T extends PAreaLType<S>>- Returns:
- The maximum X, maximum Y quadrant
-
withX0y0
Copy the current immutable object by setting a value for thex0y0attribute. 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
thisobject
-
withX1y0
Copy the current immutable object by setting a value for thex1y0attribute. 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
thisobject
-
withX0y1
Copy the current immutable object by setting a value for thex0y1attribute. 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
thisobject
-
withX1y1
Copy the current immutable object by setting a value for thex1y1attribute. 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
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofPAreaXYSplitLthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:x0y0,x1y0,x0y1,x1y1.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valuePAreaXYSplitLwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePAreaXYSplitLinstance.- Type Parameters:
S- generic parameter ST- generic parameter T- Parameters:
x0y0- The value for thex0y0attributex1y0- The value for thex1y0attributex0y1- The value for thex0y1attributex1y1- The value for thex1y1attribute- Returns:
- An immutable PAreaXYSplitL instance
-
copyOf
public static <S, T extends PAreaLType<S>> PAreaXYSplitL<S,T> copyOf(PAreaXYSplitLType<S,T> instance)Creates an immutable copy of aPAreaXYSplitLTypevalue. 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 PAreaXYSplitL instance
-
builder
Creates a builder forPAreaXYSplitL.PAreaXYSplitL.<S, T>builder() .setX0y0(T) // requiredx0y0.setX1y0(T) // requiredx1y0.setX0y1(T) // requiredx0y1.setX1y1(T) // requiredx1y1.build();- Type Parameters:
S- generic parameter ST- generic parameter T- Returns:
- A new PAreaXYSplitL builder
-