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
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> PAreaL.Builder<S>
builder()
Creates a builder forPAreaL
.static <S> PAreaL<S>
copyOf
(PAreaLType<S> instance) Creates an immutable copy of aPAreaLType
value.boolean
This instance is equal to all instances ofPAreaL
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
.long
height()
Deprecated.long
maximumX()
long
maximumY()
long
minimumX()
long
minimumY()
static <S> PAreaL<S>
of
(long minimumX, long maximumX, long minimumY, long maximumY) Construct a new immutablePAreaL
instance.long
sizeX()
long
sizeY()
toString()
Prints the immutable valuePAreaL
with attribute values.long
width()
Deprecated.UsesizeX()
withMaximumX
(long value) Copy the current immutable object by setting a value for themaximumX
attribute.withMaximumY
(long value) Copy the current immutable object by setting a value for themaximumY
attribute.withMinimumX
(long value) Copy the current immutable object by setting a value for theminimumX
attribute.withMinimumY
(long 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.parameterized.areas.PAreaLType
checkPreconditions
-
Method Details
-
width
Deprecated.UsesizeX()
- Specified by:
width
in interfaceAreaSizeValuesLType
- Returns:
- The width of the area
-
height
Deprecated.UsesizeY()
- Specified by:
height
in interfaceAreaSizeValuesLType
- Returns:
- The height of the area
-
sizeX
public long sizeX()- Specified by:
sizeX
in interfaceAreaSizeValuesLType
- Specified by:
sizeX
in interfaceAreaValuesLType
- Returns:
- The computed-at-construction value of the
sizeX
attribute
-
sizeY
public long sizeY()- Specified by:
sizeY
in interfaceAreaSizeValuesLType
- Specified by:
sizeY
in interfaceAreaValuesLType
- Returns:
- The computed-at-construction value of the
sizeY
attribute
-
minimumX
public long minimumX()- Specified by:
minimumX
in interfaceAreaValuesLType
- Specified by:
minimumX
in interfacePAreaLType<S>
- Returns:
- The value of the
minimumX
attribute
-
maximumX
public long maximumX()- Specified by:
maximumX
in interfaceAreaValuesLType
- Specified by:
maximumX
in interfacePAreaLType<S>
- Returns:
- The value of the
maximumX
attribute
-
minimumY
public long minimumY()- Specified by:
minimumY
in interfaceAreaValuesLType
- Specified by:
minimumY
in interfacePAreaLType<S>
- Returns:
- The value of the
minimumY
attribute
-
maximumY
public long maximumY()- Specified by:
maximumY
in interfaceAreaValuesLType
- Specified by:
maximumY
in interfacePAreaLType<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 ofPAreaL
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
. -
toString
Prints the immutable valuePAreaL
with attribute values. -
of
Construct a new immutablePAreaL
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 PAreaL instance
-
copyOf
Creates an immutable copy of aPAreaLType
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 PAreaL instance
-
builder
Creates a builder forPAreaL
.PAreaL.<S>builder() .setMinimumX(long) // required
minimumX
.setMaximumX(long) // requiredmaximumX
.setMinimumY(long) // requiredminimumY
.setMaximumY(long) // requiredmaximumY
.build();- Type Parameters:
S
- generic parameter S- Returns:
- A new PAreaL builder
-
sizeY()