Class AreaF
java.lang.Object
com.io7m.jregions.core.unparameterized.areas.AreaF
- All Implemented Interfaces:
AreaFType,AreaValuesFType,AreaSizeValuesFType
public final class AreaF extends java.lang.Object implements AreaFType
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
Nested Classes Modifier and Type Class Description static classAreaF.BuilderBuilds instances of typeAreaF. -
Method Summary
Modifier and Type Method Description static AreaF.Builderbuilder()Creates a builder forAreaF.static AreaFcopyOf(AreaFType instance)Creates an immutable copy of aAreaFTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofAreaFthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.floatheight()Deprecated.floatmaximumX()floatmaximumY()floatminimumX()floatminimumY()static AreaFof(float minimumX, float maximumX, float minimumY, float maximumY)Construct a new immutableAreaFinstance.java.lang.StringtoString()Prints the immutable valueAreaFwith attribute values.floatwidth()Deprecated.AreaFwithMaximumX(float value)Copy the current immutable object by setting a value for themaximumXattribute.AreaFwithMaximumY(float value)Copy the current immutable object by setting a value for themaximumYattribute.AreaFwithMinimumX(float value)Copy the current immutable object by setting a value for theminimumXattribute.AreaFwithMinimumY(float 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.AreaFType
checkPreconditionsMethods inherited from interface com.io7m.jregions.core.unparameterized.areas.AreaValuesFType
sizeX, sizeY
-
Method Details
-
width
@Deprecated public float width()Deprecated.- Specified by:
widthin interfaceAreaSizeValuesFType- Returns:
- The width of the area
-
height
@Deprecated public float height()Deprecated.- Specified by:
heightin interfaceAreaSizeValuesFType- Returns:
- The height of the area
-
minimumX
public float minimumX()- Specified by:
minimumXin interfaceAreaFType- Specified by:
minimumXin interfaceAreaValuesFType- Returns:
- The value of the
minimumXattribute
-
maximumX
public float maximumX()- Specified by:
maximumXin interfaceAreaFType- Specified by:
maximumXin interfaceAreaValuesFType- Returns:
- The value of the
maximumXattribute
-
minimumY
public float minimumY()- Specified by:
minimumYin interfaceAreaFType- Specified by:
minimumYin interfaceAreaValuesFType- Returns:
- The value of the
minimumYattribute
-
maximumY
public float maximumY()- Specified by:
maximumYin interfaceAreaFType- Specified by:
maximumYin interfaceAreaValuesFType- Returns:
- The value of the
maximumYattribute
-
withMinimumX
Copy the current immutable object by setting a value for theminimumXattribute. 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
thisobject
-
withMaximumX
Copy the current immutable object by setting a value for themaximumXattribute. 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
thisobject
-
withMinimumY
Copy the current immutable object by setting a value for theminimumYattribute. 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
thisobject
-
withMaximumY
Copy the current immutable object by setting a value for themaximumYattribute. 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
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofAreaFthat 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 valueAreaFwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableAreaFinstance.- Parameters:
minimumX- The value for theminimumXattributemaximumX- The value for themaximumXattributeminimumY- The value for theminimumYattributemaximumY- The value for themaximumYattribute- Returns:
- An immutable AreaF instance
-
copyOf
Creates an immutable copy of aAreaFTypevalue. 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) // requiredminimumX.setMaximumX(float) // requiredmaximumX.setMinimumY(float) // requiredminimumY.setMaximumY(float) // requiredmaximumY.build();- Returns:
- A new AreaF builder
-