Class PAreaL<S>
java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaL<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaLType<S>,AreaValuesLType,AreaSizeValuesLType
public final class PAreaL<S> extends java.lang.Object implements PAreaLType<S>
An area with long 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
Nested Classes Modifier and Type Class Description static classPAreaL.Builder<S>Builds instances of typePAreaL. -
Method Summary
Modifier and Type Method Description static <S> PAreaL.Builder<S>builder()Creates a builder forPAreaL.static <S> PAreaL<S>copyOf(PAreaLType<S> instance)Creates an immutable copy of aPAreaLTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaLthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.longheight()Deprecated.UsesizeY()longmaximumX()longmaximumY()longminimumX()longminimumY()static <S> PAreaL<S>of(long minimumX, long maximumX, long minimumY, long maximumY)Construct a new immutablePAreaLinstance.longsizeX()longsizeY()java.lang.StringtoString()Prints the immutable valuePAreaLwith attribute values.longwidth()Deprecated.UsesizeX()PAreaL<S>withMaximumX(long value)Copy the current immutable object by setting a value for themaximumXattribute.PAreaL<S>withMaximumY(long value)Copy the current immutable object by setting a value for themaximumYattribute.PAreaL<S>withMinimumX(long value)Copy the current immutable object by setting a value for theminimumXattribute.PAreaL<S>withMinimumY(long value)Copy the current immutable object by setting a value for theminimumYattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jregions.core.parameterized.areas.PAreaLType
checkPreconditions
-
Method Details
-
width
@Deprecated public long width()Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesLType- Returns:
- The width of the area
-
height
@Deprecated public long height()Deprecated.UsesizeY()- Specified by:
heightin interfaceAreaSizeValuesLType- Returns:
- The height of the area
-
sizeX
public long sizeX()- Specified by:
sizeXin interfaceAreaSizeValuesLType- Specified by:
sizeXin interfaceAreaValuesLType- Returns:
- The computed-at-construction value of the
sizeXattribute
-
sizeY
public long sizeY()- Specified by:
sizeYin interfaceAreaSizeValuesLType- Specified by:
sizeYin interfaceAreaValuesLType- Returns:
- The computed-at-construction value of the
sizeYattribute
-
minimumX
public long minimumX()- Specified by:
minimumXin interfaceAreaValuesLType- Specified by:
minimumXin interfacePAreaLType<S>- Returns:
- The value of the
minimumXattribute
-
maximumX
public long maximumX()- Specified by:
maximumXin interfaceAreaValuesLType- Specified by:
maximumXin interfacePAreaLType<S>- Returns:
- The value of the
maximumXattribute
-
minimumY
public long minimumY()- Specified by:
minimumYin interfaceAreaValuesLType- Specified by:
minimumYin interfacePAreaLType<S>- Returns:
- The value of the
minimumYattribute
-
maximumY
public long maximumY()- Specified by:
maximumYin interfaceAreaValuesLType- Specified by:
maximumYin interfacePAreaLType<S>- Returns:
- The value of the
maximumYattribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumXattribute. 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
thisobject
-
withMaximumX
Copy the current immutable object by setting a value for themaximumXattribute. 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
thisobject
-
withMinimumY
Copy the current immutable object by setting a value for theminimumYattribute. 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
thisobject
-
withMaximumY
Copy the current immutable object by setting a value for themaximumYattribute. 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
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofPAreaLthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valuePAreaLwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePAreaLinstance.- Type Parameters:
S- generic parameter S- Parameters:
minimumX- The value for theminimumXattributemaximumX- The value for themaximumXattributeminimumY- The value for theminimumYattributemaximumY- The value for themaximumYattribute- Returns:
- An immutable PAreaL instance
-
copyOf
Creates an immutable copy of aPAreaLTypevalue. 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 PAreaL instance
-
builder
Creates a builder forPAreaL.PAreaL.<S>builder() .setMinimumX(long) // requiredminimumX.setMaximumX(long) // requiredmaximumX.setMinimumY(long) // requiredminimumY.setMaximumY(long) // requiredmaximumY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaL builder
-