Class AreaF
java.lang.Object
com.io7m.jregions.core.unparameterized.areas.AreaF
- All Implemented Interfaces:
AreaFType
,AreaValuesFType
,AreaSizeValuesFType
An area with float
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 AreaF.Builder
builder()
Creates a builder forAreaF
.static AreaF
Creates an immutable copy of aAreaFType
value.boolean
This instance is equal to all instances ofAreaF
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
.float
height()
Deprecated.float
maximumX()
float
maximumY()
float
minimumX()
float
minimumY()
static AreaF
of
(float minimumX, float maximumX, float minimumY, float maximumY) Construct a new immutableAreaF
instance.toString()
Prints the immutable valueAreaF
with attribute values.float
width()
Deprecated.final AreaF
withMaximumX
(float value) Copy the current immutable object by setting a value for themaximumX
attribute.final AreaF
withMaximumY
(float value) Copy the current immutable object by setting a value for themaximumY
attribute.final AreaF
withMinimumX
(float value) Copy the current immutable object by setting a value for theminimumX
attribute.final AreaF
withMinimumY
(float 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.unparameterized.areas.AreaFType
checkPreconditions
Methods inherited from interface com.io7m.jregions.core.unparameterized.areas.AreaValuesFType
sizeX, sizeY
-
Method Details
-
width
Deprecated.- Specified by:
width
in interfaceAreaSizeValuesFType
- Returns:
- The width of the area
-
height
Deprecated.- Specified by:
height
in interfaceAreaSizeValuesFType
- Returns:
- The height of the area
-
minimumX
public float minimumX()- Specified by:
minimumX
in interfaceAreaFType
- Specified by:
minimumX
in interfaceAreaValuesFType
- Returns:
- The value of the
minimumX
attribute
-
maximumX
public float maximumX()- Specified by:
maximumX
in interfaceAreaFType
- Specified by:
maximumX
in interfaceAreaValuesFType
- Returns:
- The value of the
maximumX
attribute
-
minimumY
public float minimumY()- Specified by:
minimumY
in interfaceAreaFType
- Specified by:
minimumY
in interfaceAreaValuesFType
- Returns:
- The value of the
minimumY
attribute
-
maximumY
public float maximumY()- Specified by:
maximumY
in interfaceAreaFType
- Specified by:
maximumY
in interfaceAreaValuesFType
- Returns:
- The value of the
maximumY
attribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumX
attribute. A value strict bits equality 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 strict bits equality 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 strict bits equality 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 strict bits equality 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 ofAreaF
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:minimumX
,maximumX
,minimumY
,maximumY
. -
toString
Prints the immutable valueAreaF
with attribute values. -
of
Construct a new immutableAreaF
instance.- 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 AreaF instance
-
copyOf
Creates an immutable copy of aAreaFType
value. 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 AreaF instance
-
builder
Creates a builder forAreaF
.AreaF.builder() .setMinimumX(float) // required
minimumX
.setMaximumX(float) // requiredmaximumX
.setMinimumY(float) // requiredminimumY
.setMaximumY(float) // requiredmaximumY
.build();- Returns:
- A new AreaF builder
-
AreaValuesFType.sizeY()