Class AreaI
java.lang.Object
com.io7m.jregions.core.unparameterized.areas.AreaI
- All Implemented Interfaces:
AreaIType,AreaValuesIType,AreaSizeValuesIType
An area with int 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 AreaI.Builderbuilder()Creates a builder forAreaI.static AreaICreates an immutable copy of aAreaITypevalue.booleanThis instance is equal to all instances ofAreaIthat have equal attribute values.inthashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY.intheight()Deprecated.intmaximumX()intmaximumY()intminimumX()intminimumY()static AreaIof(int minimumX, int maximumX, int minimumY, int maximumY) Construct a new immutableAreaIinstance.toString()Prints the immutable valueAreaIwith attribute values.intwidth()Deprecated.final AreaIwithMaximumX(int value) Copy the current immutable object by setting a value for themaximumXattribute.final AreaIwithMaximumY(int value) Copy the current immutable object by setting a value for themaximumYattribute.final AreaIwithMinimumX(int value) Copy the current immutable object by setting a value for theminimumXattribute.final AreaIwithMinimumY(int 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.AreaIType
checkPreconditionsMethods inherited from interface com.io7m.jregions.core.unparameterized.areas.AreaValuesIType
sizeX, sizeY
-
Method Details
-
width
Deprecated.- Specified by:
widthin interfaceAreaSizeValuesIType- Returns:
- The width of the area
-
height
Deprecated.- Specified by:
heightin interfaceAreaSizeValuesIType- Returns:
- The height of the area
-
minimumX
public int minimumX()- Specified by:
minimumXin interfaceAreaIType- Specified by:
minimumXin interfaceAreaValuesIType- Returns:
- The value of the
minimumXattribute
-
maximumX
public int maximumX()- Specified by:
maximumXin interfaceAreaIType- Specified by:
maximumXin interfaceAreaValuesIType- Returns:
- The value of the
maximumXattribute
-
minimumY
public int minimumY()- Specified by:
minimumYin interfaceAreaIType- Specified by:
minimumYin interfaceAreaValuesIType- Returns:
- The value of the
minimumYattribute
-
maximumY
public int maximumY()- Specified by:
maximumYin interfaceAreaIType- Specified by:
maximumYin interfaceAreaValuesIType- 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 ofAreaIthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:minimumX,maximumX,minimumY,maximumY. -
toString
Prints the immutable valueAreaIwith attribute values. -
of
Construct a new immutableAreaIinstance.- Parameters:
minimumX- The value for theminimumXattributemaximumX- The value for themaximumXattributeminimumY- The value for theminimumYattributemaximumY- The value for themaximumYattribute- Returns:
- An immutable AreaI instance
-
copyOf
Creates an immutable copy of aAreaITypevalue. 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 AreaI instance
-
builder
Creates a builder forAreaI.AreaI.builder() .setMinimumX(int) // requiredminimumX.setMaximumX(int) // requiredmaximumX.setMinimumY(int) // requiredminimumY.setMaximumY(int) // requiredmaximumY.build();- Returns:
- A new AreaI builder
-
AreaValuesIType.sizeY()