Class AreaL
java.lang.Object
com.io7m.jregions.core.unparameterized.areas.AreaL
- All Implemented Interfaces:
AreaLType,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
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic AreaL.Builderbuilder()Creates a builder forAreaL.static AreaLCreates an immutable copy of aAreaLTypevalue.booleanThis instance is equal to all instances ofAreaLthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.longheight()Deprecated.longmaximumX()longmaximumY()longminimumX()longminimumY()static AreaLof(long minimumX, long maximumX, long minimumY, long maximumY) Construct a new immutableAreaLinstance.longsizeX()longsizeY()toString()Prints the immutable valueAreaLwith attribute values.longwidth()Deprecated.UsesizeX()final AreaLwithMaximumX(long value) Copy the current immutable object by setting a value for themaximumXattribute.final AreaLwithMaximumY(long value) Copy the current immutable object by setting a value for themaximumYattribute.final AreaLwithMinimumX(long value) Copy the current immutable object by setting a value for theminimumXattribute.final AreaLwithMinimumY(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.unparameterized.areas.AreaLType
checkPreconditions
-
Method Details
-
width
Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesLType- Returns:
- The width of the area
-
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 interfaceAreaLType- Specified by:
minimumXin interfaceAreaValuesLType- Returns:
- The value of the
minimumXattribute
-
maximumX
public long maximumX()- Specified by:
maximumXin interfaceAreaLType- Specified by:
maximumXin interfaceAreaValuesLType- Returns:
- The value of the
maximumXattribute
-
minimumY
public long minimumY()- Specified by:
minimumYin interfaceAreaLType- Specified by:
minimumYin interfaceAreaValuesLType- Returns:
- The value of the
minimumYattribute
-
maximumY
public long maximumY()- Specified by:
maximumYin interfaceAreaLType- Specified by:
maximumYin interfaceAreaValuesLType- 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
This instance is equal to all instances ofAreaLthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY. -
toString
Prints the immutable valueAreaLwith attribute values. -
of
Construct a new immutableAreaLinstance.- Parameters:
minimumX- The value for theminimumXattributemaximumX- The value for themaximumXattributeminimumY- The value for theminimumYattributemaximumY- The value for themaximumYattribute- Returns:
- An immutable AreaL instance
-
copyOf
Creates an immutable copy of aAreaLTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable AreaL instance
-
builder
Creates a builder forAreaL.AreaL.builder() .setMinimumX(long) // requiredminimumX.setMaximumX(long) // requiredmaximumX.setMinimumY(long) // requiredminimumY.setMaximumY(long) // requiredmaximumY.build();- Returns:
- A new AreaL builder
-
sizeY()