Class PAreasBI
public final class PAreasBI
extends java.lang.Object
Functions over areas.
These functions operate using the concepts of minimum-x, maximum-x, minimum-y, and maximum-y edges. It is up to individual applications to assign meaning to these edges such as "left" for minimum-x and "top" for minimum-y.
-
Method Summary
Modifier and Type Method Description static <S> PAreaBI<S>alignCenter(PAreaBI<S> outer, PAreaBI<S> inner)Align the areainnersuch that the center of the area is equal to the center ofouter.static <S> PAreaBI<S>alignHorizontallyCenter(PAreaBI<S> outer, PAreaBI<S> inner)Deprecated.static <S> PAreaBI<S>alignHorizontallyMaxX(PAreaBI<S> outer, PAreaBI<S> inner)Deprecated.static <S> PAreaBI<S>alignHorizontallyMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.static <S> PAreaBI<S>alignHorizontallyMinX(PAreaBI<S> outer, PAreaBI<S> inner)Deprecated.static <S> PAreaBI<S>alignHorizontallyMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.static <S> PAreaBI<S>alignMaxYMaxX(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignMaxYMaxXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.static <S> PAreaBI<S>alignMaxYMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.static <S> PAreaBI<S>alignMaxYMinX(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignMaxYMinXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.static <S> PAreaBI<S>alignMaxYMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.static <S> PAreaBI<S>alignMinYMaxX(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignMinYMaxXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.static <S> PAreaBI<S>alignMinYMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.static <S> PAreaBI<S>alignMinYMinX(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignMinYMinXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.static <S> PAreaBI<S>alignMinYMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.static <S> PAreaBI<S>alignOnXCenter(PAreaBI<S> outer, PAreaBI<S> inner)Align the areainneralong the X axis in the center ofouter.static <S> PAreaBI<S>alignOnXMaxX(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignOnXMaxXOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.static <S> PAreaBI<S>alignOnXMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the X axis against the inside maximum-x edge ofouter.static <S> PAreaBI<S>alignOnXMinX(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignOnXMinXOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.static <S> PAreaBI<S>alignOnXMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the X axis against the inside minimum-x edge ofouter.static <S> PAreaBI<S>alignOnYCenter(PAreaBI<S> outer, PAreaBI<S> inner)Align the areainneralong the Y axis in the center ofouter.static <S> PAreaBI<S>alignOnYMaxY(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignOnYMaxYOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.static <S> PAreaBI<S>alignOnYMaxYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the Y axis against the inside maximum-y edge ofouter.static <S> PAreaBI<S>alignOnYMinY(PAreaBI<S> outer, PAreaBI<S> inner)Equivalent to callingalignOnYMinYOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.static <S> PAreaBI<S>alignOnYMinYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the Y axis against the inside minimum-y edge ofouter.static <S> PAreaBI<S>alignVerticallyCenter(PAreaBI<S> outer, PAreaBI<S> inner)Deprecated.static <S> PAreaBI<S>alignVerticallyMaxY(PAreaBI<S> outer, PAreaBI<S> inner)Deprecated.static <S> PAreaBI<S>alignVerticallyMaxYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.static <S> PAreaBI<S>alignVerticallyMinY(PAreaBI<S> outer, PAreaBI<S> inner)Deprecated.static <S> PAreaBI<S>alignVerticallyMinYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.static <S, T> PAreaBI<T>cast(PAreaBI<S> area)Brand a given area as belonging to a different coordinate space.static <S> PAreaBI<S>containing(PAreaBI<S> a, PAreaBI<S> b)Construct a area that will contain bothaandb.static <S> booleancontains(PAreaBI<S> a, PAreaBI<S> b)Determine whether or not one area contains another.static <S> booleancontainsPoint(PAreaBI<S> a, java.math.BigInteger x, java.math.BigInteger y)Determine whether or not a area contains a given point.static <S> booleancouldFitInside(PAreaBI<S> a, PAreaBI<S> b)Determine whether or not one area could fit inside another.static <S> PAreaBI<S>create(java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger size_x, java.math.BigInteger size_y)Create an area of sizesize_xon the X axis and sizesize_yon the Y axis, placing the minimum corner at(x, y).static <S> PAreaBI<S>fitBetweenHorizontal(PAreaBI<S> fit, PAreaBI<S> a, PAreaBI<S> b)Deprecated.static <S> PAreaBI<S>fitBetweenOnX(PAreaBI<S> fit, PAreaBI<S> a, PAreaBI<S> b)Attempt to fitfitbetweenaandb, horizontally.static <S> PAreaBI<S>fitBetweenOnY(PAreaBI<S> fit, PAreaBI<S> a, PAreaBI<S> b)Attempt to fitfitbetweenaandb, vertically.static <S> PAreaBI<S>fitBetweenVertical(PAreaBI<S> fit, PAreaBI<S> a, PAreaBI<S> b)Deprecated.static <S> PAreaBI<S>hollowOut(PAreaBI<S> outer, java.math.BigInteger min_x_offset, java.math.BigInteger max_x_offset, java.math.BigInteger min_y_offset, java.math.BigInteger max_y_offset)Construct a new area that fits insideouterbased on the given offsets from each edge.static <S> PAreaBI<S>hollowOutEvenly(PAreaBI<S> outer, java.math.BigInteger offset)Equivalent to callinghollowOut(PAreaBI, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger)withoffsetfor all offset parameters.static <S> PAreaBI<S>moveAbsolute(PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Move the given area to(x, y).static <S> PAreaBI<S>moveRelative(PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Move the given area by(x, y).static <S> PAreaBI<S>moveRelativeClamped(PAreaBI<S> container, PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Move the given area by(x, y), without allowingareato leavecontainer.static <S> PAreaBI<S>moveRelativeClampedX(PAreaBI<S> container, PAreaBI<S> area, java.math.BigInteger x)Move the given area byx, without allowingareato leavecontainer.static <S> PAreaBI<S>moveRelativeClampedY(PAreaBI<S> container, PAreaBI<S> area, java.math.BigInteger y)Move the given area byy, without allowingareato leavecontainer.static <S> PAreaBI<S>moveToOrigin(PAreaBI<S> area)Move the given area to(0, 0).static <S> booleanoverlaps(PAreaBI<S> a, PAreaBI<S> b)Determine whether or not two areas overlap.static <S> PAreaBI<S>scaleFromCenter(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaBI<S>scaleFromMaxYMaxX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaBI<S>scaleFromMaxYMinX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaBI<S>scaleFromMinYMaxX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaBI<S>scaleFromMinYMinX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaBI<S>setSizeFromCenter(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaBI<S>setSizeFromMaxYMaxX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaBI<S>setSizeFromMaxYMinX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaBI<S>setSizeFromMinYMaxX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaBI<S>setSizeFromMinYMinX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> java.lang.Stringshow(PAreaBI<S> area)static <S> java.lang.StringshowToBuilder(PAreaBI<S> area, java.lang.StringBuilder sb)static <S> PAreaSizeBI<S>size(PAreaBI<S> area)static <S> PAreaXSplitBI<S,PAreaBI<S>>splitAlongParallelToX(PAreaBI<S> area, java.math.BigInteger y)Splitareaalong a line parallel to the X axis placed atyunits from its own minimum-y edge.static <S> PAreaYSplitBI<S,PAreaBI<S>>splitAlongParallelToY(PAreaBI<S> area, java.math.BigInteger x)Splitareaalong a line parallel to the Y axis placed atxunits from its own minimum-x edge.static <S> PAreaXYSplitBI<S,PAreaBI<S>>splitAlongXY(PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Splitareaalong a two axis-aligned perpendicular lines that intercept at(x, y).
-
Method Details
-
create
public static <S> PAreaBI<S> create(java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger size_x, java.math.BigInteger size_y)Create an area of sizesize_xon the X axis and sizesize_yon the Y axis, placing the minimum corner at(x, y).- Type Parameters:
S- The coordinate space of the areas- Parameters:
x- The X value of the minimum cornery- The Y value of the minimum cornersize_x- The size of the area on the X axissize_y- The size of the area on the Y axis- Returns:
- An area
-
contains
Determine whether or not one area contains another.
Containing is reflexive:
contains(a, a) == true.Containing is transitive:
contains(a, b) → contains(b, c) → contains(a, c).Containing is not necessarily symmetric.
- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- Area Ab- Area B- Returns:
trueiffacontainsb
-
moveRelative
public static <S> PAreaBI<S> moveRelative(PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Move the given area by(x, y).- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax- The amount to move on the X axisy- The amount to move on the Y axis- Returns:
- A moved area
-
moveRelativeClampedX
public static <S> PAreaBI<S> moveRelativeClampedX(PAreaBI<S> container, PAreaBI<S> area, java.math.BigInteger x)Move the given area byx, without allowingareato leavecontainer.- Type Parameters:
S- The coordinate space of the area- Parameters:
container- The container areaarea- The areax- The amount to move on the X axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveRelativeClampedY
public static <S> PAreaBI<S> moveRelativeClampedY(PAreaBI<S> container, PAreaBI<S> area, java.math.BigInteger y)Move the given area byy, without allowingareato leavecontainer.- Type Parameters:
S- The coordinate space of the area- Parameters:
container- The container areaarea- The areay- The amount to move on the Y axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveRelativeClamped
public static <S> PAreaBI<S> moveRelativeClamped(PAreaBI<S> container, PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Move the given area by(x, y), without allowingareato leavecontainer.- Type Parameters:
S- The coordinate space of the area- Parameters:
container- The container areaarea- The areax- The amount to move on the X axisy- The amount to move on the Y axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveAbsolute
public static <S> PAreaBI<S> moveAbsolute(PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Move the given area to(x, y).- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax- The position to which to move on the X axisy- The position to which to move on the Y axis- Returns:
- A moved area
-
moveToOrigin
Move the given area to(0, 0).- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The area- Returns:
- A moved area
-
cast
Brand a given area as belonging to a different coordinate space. Mixing up coordinate spaces is a common source of difficult-to-locate bugs. Use at your own risk.- Type Parameters:
S- The starting coordinate spaceT- The resulting coordinate space- Parameters:
area- An area- Returns:
area
-
alignHorizontallyCenter
@Deprecated public static <S> PAreaBI<S> alignHorizontallyCenter(PAreaBI<S> outer, PAreaBI<S> inner)Deprecated.Align the areainnerhorizontally in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinX
Deprecated.Equivalent to callingalignHorizontallyMinXOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinXOffset
@Deprecated public static <S> PAreaBI<S> alignHorizontallyMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.Align the areainnerhorizontally against the inside minimum-x edge ofouter. The area will be at leastoffsetunits from the minimum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignHorizontallyMaxX
Deprecated.Equivalent to callingalignHorizontallyMaxXOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMaxXOffset
@Deprecated public static <S> PAreaBI<S> alignHorizontallyMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.Align the areainnerhorizontally against the inside maximum-x edge ofouter. The area will be at leastoffsetunits from the maximum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMinY
Deprecated.Equivalent to callingalignVerticallyMinYOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignVerticallyMinYOffset
@Deprecated public static <S> PAreaBI<S> alignVerticallyMinYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.Align the areainnervertically against the inside minimum-y edge ofouter. The area will be at leastoffsetunits from the minimum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMaxY
Deprecated.Equivalent to callingalignVerticallyMaxYOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignVerticallyMaxYOffset
@Deprecated public static <S> PAreaBI<S> alignVerticallyMaxYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Deprecated.Align the areainnervertically against the inside maximum-y edge ofouter. The area will be at leastoffsetunits from the maximum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyCenter
Deprecated.Align the areainnervertically in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignOnXCenter
Align the areainneralong the X axis in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMinX
Equivalent to callingalignOnXMinXOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMinXOffset
public static <S> PAreaBI<S> alignOnXMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the X axis against the inside minimum-x edge ofouter. The area will be at leastoffsetunits from the minimum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMaxX
Equivalent to callingalignOnXMaxXOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMaxXOffset
public static <S> PAreaBI<S> alignOnXMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the X axis against the inside maximum-x edge ofouter. The area will be at leastoffsetunits from the maximum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMinY
Equivalent to callingalignOnYMinYOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMinYOffset
public static <S> PAreaBI<S> alignOnYMinYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the Y axis against the inside minimum-y edge ofouter. The area will be at leastoffsetunits from the minimum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMaxY
Equivalent to callingalignOnYMaxYOffset(PAreaBI, PAreaBI, java.math.BigInteger)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMaxYOffset
public static <S> PAreaBI<S> alignOnYMaxYOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset)Align the areainneralong the Y axis against the inside maximum-y edge ofouter. The area will be at leastoffsetunits from the maximum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYCenter
Align the areainneralong the Y axis in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignMinYMinX
Equivalent to callingalignMinYMinXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMinYMinXOffset
public static <S> PAreaBI<S> alignMinYMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the minimum-x edgeoffset_y- The offset from the minimum-y edge- Returns:
- An aligned area
-
alignMinYMaxX
Equivalent to callingalignMinYMaxXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMinYMaxXOffset
public static <S> PAreaBI<S> alignMinYMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the maximum-x edgeoffset_y- The offset from the minimum-y edge- Returns:
- An aligned area
-
alignMaxYMinX
Equivalent to callingalignMaxYMinXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMaxYMinXOffset
public static <S> PAreaBI<S> alignMaxYMinXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the minimum-x edgeoffset_y- The offset from the maximum-y edge- Returns:
- An aligned area
-
alignMaxYMaxX
Equivalent to callingalignMaxYMaxXOffset(PAreaBI, PAreaBI, java.math.BigInteger, java.math.BigInteger)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMaxYMaxXOffset
public static <S> PAreaBI<S> alignMaxYMaxXOffset(PAreaBI<S> outer, PAreaBI<S> inner, java.math.BigInteger offset_x, java.math.BigInteger offset_y)Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the maximum-x edgeoffset_y- The offset from the maximum-y edge- Returns:
- An aligned area
-
alignCenter
Align the areainnersuch that the center of the area is equal to the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
hollowOut
public static <S> PAreaBI<S> hollowOut(PAreaBI<S> outer, java.math.BigInteger min_x_offset, java.math.BigInteger max_x_offset, java.math.BigInteger min_y_offset, java.math.BigInteger max_y_offset)Construct a new area that fits insideouterbased on the given offsets from each edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The containing areamin_x_offset- The offset from the minimum-x edge (must be non-negative)max_x_offset- The offset from the maximum-x edge (must be non-negative)min_y_offset- The offset from the minimum-y edge (must be non-negative)max_y_offset- The offset from the maximum-y edge (must be non-negative)- Returns:
- A new area
-
hollowOutEvenly
Equivalent to callinghollowOut(PAreaBI, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger)withoffsetfor all offset parameters.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The containing areaoffset- The offset from each edge (must be non-negative)- Returns:
- A new area
-
setSizeFromCenter
public static <S> PAreaBI<S> setSizeFromCenter(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized from its own center.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMinX
public static <S> PAreaBI<S> setSizeFromMinYMinX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its minimum-y-minimum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMaxX
public static <S> PAreaBI<S> setSizeFromMinYMaxX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its minimum-y-maximum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMaxX
public static <S> PAreaBI<S> setSizeFromMaxYMaxX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its maximum-y-maximum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMinX
public static <S> PAreaBI<S> setSizeFromMaxYMinX(PAreaBI<S> area, java.math.BigInteger sizeX, java.math.BigInteger sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its maximum-y-minimum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
scaleFromMinYMinX
public static <S> PAreaBI<S> scaleFromMinYMinX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scale
areaby addingx_diffto the sizeX, andy_diffto the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its minimum-y-minimum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMinYMaxX
public static <S> PAreaBI<S> scaleFromMinYMaxX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scale
areaby addingx_diffto the sizeX, andy_diffto the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its minimum-y-maximum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMinX
public static <S> PAreaBI<S> scaleFromMaxYMinX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scale
areaby addingx_diffto the sizeX, andy_diffto the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its maximum-y-minimum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMaxX
public static <S> PAreaBI<S> scaleFromMaxYMaxX(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scale
areaby addingx_diffto the sizeX, andy_diffto the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its maximum-y-maximum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromCenter
public static <S> PAreaBI<S> scaleFromCenter(PAreaBI<S> area, java.math.BigInteger x_diff, java.math.BigInteger y_diff)Scale
areaby addingx_diffto the sizeX, andy_diffto the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized from its own center.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
overlaps
Determine whether or not two areas overlap.
Overlapping is reflexive:
overlaps(a, a) == true.Overlapping is symmetric:
overlaps(a, b) == overlaps(b, a).Overlapping is not necessarily transitive.
- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- An areab- An area- Returns:
trueiffaoverlapsb
-
couldFitInside
Determine whether or not one area could fit inside another.
Fitting is reflexive:
couldFitInside(a, a) == true.Fitting is transitive:
couldFitInside(a, b) → couldFitInside(b, c) → couldFitInside(a, c).Fitting is not necessarily symmetric.
- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- An areab- An area- Returns:
trueiffacould fit insideb
-
containing
Construct a area that will contain bothaandb.- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- An areab- An area- Returns:
- An area containing
aandb
-
containsPoint
public static <S> boolean containsPoint(PAreaBI<S> a, java.math.BigInteger x, java.math.BigInteger y)Determine whether or not a area contains a given point.
- Type Parameters:
S- The coordinate space of the area- Parameters:
a- An areax- The X coordinate of the pointy- The Y coordinate of the point- Returns:
trueiffacontains(x, y)
-
fitBetweenHorizontal
@Deprecated public static <S> PAreaBI<S> fitBetweenHorizontal(PAreaBI<S> fit, PAreaBI<S> a, PAreaBI<S> b)Deprecated.Attempt to fitfitbetweenaandb, horizontally.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenVertical
@Deprecated public static <S> PAreaBI<S> fitBetweenVertical(PAreaBI<S> fit, PAreaBI<S> a, PAreaBI<S> b)Deprecated.Attempt to fitfitbetweenaandb, vertically.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenOnX
Attempt to fitfitbetweenaandb, horizontally.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenOnY
Attempt to fitfitbetweenaandb, vertically.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
splitAlongParallelToX
public static <S> PAreaXSplitBI<S,PAreaBI<S>> splitAlongParallelToX(PAreaBI<S> area, java.math.BigInteger y)Splitareaalong a line parallel to the X axis placed atyunits from its own minimum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
area- The area to be splity- The relative Y coordinate of the splitting edge- Returns:
- A pair of areas
-
splitAlongParallelToY
public static <S> PAreaYSplitBI<S,PAreaBI<S>> splitAlongParallelToY(PAreaBI<S> area, java.math.BigInteger x)Splitareaalong a line parallel to the Y axis placed atxunits from its own minimum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
area- The area to be splitx- The relative X coordinate of the splitting edge- Returns:
- A pair of areas
-
splitAlongXY
public static <S> PAreaXYSplitBI<S,PAreaBI<S>> splitAlongXY(PAreaBI<S> area, java.math.BigInteger x, java.math.BigInteger y)Splitareaalong a two axis-aligned perpendicular lines that intercept at(x, y).- Type Parameters:
S- The coordinate space of the areas- Parameters:
area- The area to be splitx- The relative X coordinate of the splitting edgey- The relative Y coordinate of the splitting edge- Returns:
- The four resulting quadrants
- Since:
- 1.1.0
-
show
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The area- Returns:
- A terse string describing the position and size of the area
-
size
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The area- Returns:
- The size of the area
-
showToBuilder
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasb- A string builder- Returns:
- A terse string describing the position and size of the area
-