APIdia Launch Partner
Top Description Fields Constructors Methods
sun.java2d.pipe

public final Class Region

extends Object
Class Inheritance
Imports
java.awt.Rectangle, .Shape, java.awt.geom.AffineTransform, .Rectangle2D, .RectangularShape, sun.java2d.loops.TransformHelper

This class encapsulates a definition of a two dimensional region which consists of a number of Y ranges each containing multiple X bands.

A rectangular Region is allowed to have a null band list in which case the rectangular shape is defined by the bounding box parameters (lox, loy, hix, hiy).

The band list, if present, consists of a list of rows in ascending Y order, ending at endIndex which is the index beyond the end of the last row. Each row consists of at least 3 + 2n entries (n >= 1) where the first 3 entries specify the Y range as start, end, and the number of X ranges in that Y range. These 3 entries are followed by pairs of X coordinates in ascending order:

bands[rowstart+0] = Y0;        // starting Y coordinate
bands[rowstart+1] = Y1;        // ending Y coordinate - endY > startY
bands[rowstart+2] = N;         // number of X bands - N >= 1

bands[rowstart+3] = X10;       // starting X coordinate of first band
bands[rowstart+4] = X11;       // ending X coordinate of first band
bands[rowstart+5] = X20;       // starting X coordinate of second band
bands[rowstart+6] = X21;       // ending X coordinate of second band
...
bands[rowstart+3+N*2-2] = XN0; // starting X coord of last band
bands[rowstart+3+N*2-1] = XN1; // ending X coord of last band

bands[rowstart+3+N*2] = ...    // start of next Y row

Field Summary

Modifier and TypeField and Description
pack-priv int[]
public static final Region
pack-priv int
private static final int
private int
private int
private static final int
private static final int
private static final int
private static final int
private int
private int
public static final Region

Constructor Summary

AccessConstructor and Description
private
Region(int lox, int loy, int hix, int hiy)

private
Region(int lox, int loy, int hix, int hiy, int[] bands, int end)

Method Summary

Modifier and TypeMethod and Description
private void
appendSpan(int[] box)

Appends a single span defined by the 4 parameters spanlox, spanloy, spanhix, spanhiy.

private void
appendSpans(SpanIterator si)

Appends the list of spans returned from the indicated SpanIterator.

private void
public static int
clipAdd(int v, int dv)

Adds the delta dv to the value v with appropriate clipping to the bounds of Integer resolution.

public void
clipBoxToBounds(int[] bbox)

Clips the indicated bbox array to the bounds of this Region.

public static int

Returns:

the value of the argument rounded to the nearest int value.
clipRound
(final double
a floating-point value to be rounded to an integer
coordinate
)

Returns the closest int to the argument, with ties rounding to negative infinity.

public static int
clipScale(final int v, final double sv)

Multiply the scale factor sv and the value v with appropriate clipping to the bounds of Integer resolution.

public boolean
contains(int x, int y)

Returns true iff this Region contains the specified coordinate.

public static int
dimAdd(int start, int dim)

Adds the dimension dim to the coordinate start with appropriate clipping.

public boolean
encompasses(Region r)

Quickly checks if this Region surrounds the specified Region object.

public boolean
encompassesXYWH(int x, int y, int w, int h)

Quickly checks if this Region surrounds the specified rectangular area specified in x, y, width, height format.

public boolean
encompassesXYXY(int lox, int loy, int hix, int hiy)

Quickly checks if this Region surrounds the specified rectangular area specified in lox, loy, hix, hiy format.

private void
endRow(int[] box)

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public SpanIterator
filter(SpanIterator si)

Returns a SpanIterator that is the argument iterator filtered by this region.

private void
filterSpans(Region ra, Region rb, int flags)

public void
getBounds(int[] pathbox)

Gets the bbox of the available spans, clipped to the OutputArea.

public Region
getBoundsIntersection(Rectangle r)

Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified Region object.

public Region
getBoundsIntersection(Region r)

Returns a Region object that represents the intersection of this object with the bounds of the specified Region object.

public Region
getBoundsIntersectionXYWH(int x, int y, int w, int h)

Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in x, y, width, height format.

public Region
getBoundsIntersectionXYXY(int lox, int loy, int hix, int hiy)

Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in lox, loy, hix, hiy format.

public Region
getDifference(Region r)

Returns a Region object that represents the difference of the specified Region object subtracted from this object.

public Region
getExclusiveOr(Region r)

Returns a Region object that represents the exclusive or of this object with the specified Region object.

public int
getHeight()

Returns the height of this Region clipped to the range (0 - MAX_INT).

public int
getHiX()

Returns the highest X coordinate in the Region.

public int
getHiY()

Returns the highest Y coordinate in the Region.

public static Region
getInstance(Shape
a non-null Shape object specifying the geometry enclosing the pixels of interest
s
,
AffineTransform
an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
at
)

Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object.

public static Region
getInstance(Region
a non-null Region specifying some bounds to clip the geometry to
devBounds
,
Shape
a non-null Shape object specifying the geometry enclosing the pixels of interest
s
,
AffineTransform
an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
at
)

Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds.

public static Region
getInstance(Region
a non-null Region specifying some bounds to clip the geometry to
devBounds
,
boolean
a boolean indicating whether or not to apply normalization
normalize
,
Shape
a non-null Shape object specifying the geometry enclosing the pixels of interest
s
,
AffineTransform
an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
at
)

Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds.

pack-priv static Region
getInstance(final int lox, final int loy, final int hix, final int hiy, final int[] edges)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy and edges array, which is located relative to the rectangular area.

public static Region
getInstance(Rectangle r)

Returns a Region object with a rectangle of interest specified by the indicated Rectangle object.

public static Region
getInstance(int[] box)

Returns a Region object with a rectangle of interest specified by the indicated span array.

public static Region
getInstance(int[] box, SpanIterator si)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format.

public static Region
getInstanceXYWH(int x, int y, int w, int h)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in x, y, width, height format.

public static Region
getInstanceXYXY(int lox, int loy, int hix, int hiy)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format.

public Region
getIntersection(Rectangle r)

Returns a Region object that represents the intersection of this object with the specified Rectangle.

public Region
getIntersection(final Rectangle2D r)

Returns a Region object that represents the intersection of this object with the specified Rectangle2D.

public Region
getIntersection(Region r)

Returns a Region object that represents the intersection of this object with the specified Region object.

public Region
getIntersectionXYWH(int x, int y, int w, int h)

Returns a Region object that represents the intersection of this object with the specified rectangular area.

public Region
getIntersectionXYXY(double lox, double loy, double hix, double hiy)

Returns a Region object that represents the intersection of this object with the specified rectangular area.

public Region
getIntersectionXYXY(int lox, int loy, int hix, int hiy)

Returns a Region object that represents the intersection of this object with the specified rectangular area.

public RegionIterator
getIterator()

Gets an iterator object to iterate over the spans in this region.

public int
getLoX()

Returns the lowest X coordinate in the Region.

public int
getLoY()

Returns the lowest Y coordinate in the Region.

private Region
getSafeTranslatedRegion(int dx, int dy)

public Region
getScaledRegion(final double sx, final double sy)

Returns a Region object that represents the same list of rectangles as the current Region object, scaled by the specified sx, sy factors.

public SpanIterator
getSpanIterator()

Gets a span iterator object that iterates over the spans in this region

public SpanIterator
getSpanIterator(int[] bbox)

Gets a span iterator object that iterates over the spans in this region but clipped to the bounds given in the argument (xlo, ylo, xhi, yhi).

public Region
getTranslatedRegion(int dx, int dy)

Returns a Region object that represents the same list of rectangles as the current Region object, translated by the specified dx, dy translation factors.

public Region
getUnion(Region r)

Returns a Region object that represents the union of this object with the specified Region object.

public int
getWidth()

Returns the width of this Region clipped to the range (0 - MAX_INT).

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private static native void
public boolean
intersectsQuickCheck(Region r)

Quickly checks if this Region intersects the specified Region object.

public boolean
intersectsQuickCheckXYXY(int lox, int loy, int hix, int hiy)

Quickly checks if this Region intersects the specified rectangular area specified in lox, loy, hix, hiy format.

public boolean
isEmpty()

Returns true iff this Region encloses no area.

public boolean
isInsideQuickCheck(Region r)

Quickly checks if this Region lies inside the specified Region object.

public boolean
isInsideXYWH(int x, int y, int w, int h)

Returns true iff this Region lies inside the indicated rectangular area specified in x, y, width, height format with appropriate clipping performed as per the dimAdd method.

public boolean
isInsideXYXY(int lox, int loy, int hix, int hiy)

Returns true iff this Region lies inside the indicated rectangular area specified in lox, loy, hix, hiy format.

public boolean
isRectangular()

Returns true iff this Region represents a single simple rectangular area.

private void
needSpace(int num)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

bandsback to summary
pack-priv int[] bands
EMPTY_REGIONback to summary
public static final Region EMPTY_REGION
endIndexback to summary
pack-priv int endIndex
GROW_SIZEback to summary
private static final int GROW_SIZE
hixback to summary
private int hix
hiyback to summary
private int hiy
INCLUDE_Aback to summary
private static final int INCLUDE_A
INCLUDE_Bback to summary
private static final int INCLUDE_B
INCLUDE_COMMONback to summary
private static final int INCLUDE_COMMON
INIT_SIZEback to summary
private static final int INIT_SIZE
loxback to summary
private int lox
loyback to summary
private int loy
WHOLE_REGIONback to summary
public static final Region WHOLE_REGION

Constructor Detail

Regionback to summary
private Region(int lox, int loy, int hix, int hiy)
Regionback to summary
private Region(int lox, int loy, int hix, int hiy, int[] bands, int end)

Method Detail

appendSpanback to summary
private void appendSpan(int[] box)

Appends a single span defined by the 4 parameters spanlox, spanloy, spanhix, spanhiy. This span must be at a higher starting Y coordinate than the previous data or it must have a Y range equal to the highest Y band in the region and a higher X coordinate than any of the spans in that band.

appendSpansback to summary
private void appendSpans(SpanIterator si)

Appends the list of spans returned from the indicated SpanIterator. Each span must be at a higher starting Y coordinate than the previous data or it must have a Y range equal to the highest Y band in the region and a higher X coordinate than any of the spans in that band.

calcBBoxback to summary
private void calcBBox()
clipAddback to summary
public static int clipAdd(int v, int dv)

Adds the delta dv to the value v with appropriate clipping to the bounds of Integer resolution. If the answer would be greater than Integer.MAX_VALUE then Integer.MAX_VALUE is returned. If the answer would be less than Integer.MIN_VALUE then Integer.MIN_VALUE is returned. Otherwise the sum is returned.

clipBoxToBoundsback to summary
public void clipBoxToBounds(int[] bbox)

Clips the indicated bbox array to the bounds of this Region.

clipRoundback to summary
public static int clipRound(final double coordinate)

Returns the closest int to the argument, with ties rounding to negative infinity.

Special cases:

  • If the argument is NaN, the result is 0.
  • If the argument is negative infinity or any value less than or equal to the value of Integer.MIN_VALUE, the result is equal to the value of Integer.MIN_VALUE.
  • If the argument is positive infinity or any value greater than or equal to the value of Integer.MAX_VALUE, the result is equal to the value of Integer.MAX_VALUE.
Parameters
coordinate:double

a floating-point value to be rounded to an integer

Returns:int

the value of the argument rounded to the nearest int value.

clipScaleback to summary
public static int clipScale(final int v, final double sv)

Multiply the scale factor sv and the value v with appropriate clipping to the bounds of Integer resolution. If the answer would be greater than Integer.MAX_VALUE then Integer.MAX_VALUE is returned. If the answer would be less than Integer.MIN_VALUE then Integer.MIN_VALUE is returned. Otherwise the multiplication is returned.

containsback to summary
public boolean contains(int x, int y)

Returns true iff this Region contains the specified coordinate.

dimAddback to summary
public static int dimAdd(int start, int dim)

Adds the dimension dim to the coordinate start with appropriate clipping. If dim is non-positive then the method returns the start coordinate. If the sum overflows an integer data type then the method returns Integer.MAX_VALUE.

encompassesback to summary
public boolean encompasses(Region r)

Quickly checks if this Region surrounds the specified Region object.

This method will return false if this Region object is not a simple rectangle.

encompassesXYWHback to summary
public boolean encompassesXYWH(int x, int y, int w, int h)

Quickly checks if this Region surrounds the specified rectangular area specified in x, y, width, height format.

This method will return false if this Region object is not a simple rectangle.

encompassesXYXYback to summary
public boolean encompassesXYXY(int lox, int loy, int hix, int hiy)

Quickly checks if this Region surrounds the specified rectangular area specified in lox, loy, hix, hiy format.

This method will return false if this Region object is not a simple rectangle.

endRowback to summary
private void endRow(int[] box)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
filterback to summary
public SpanIterator filter(SpanIterator si)

Returns a SpanIterator that is the argument iterator filtered by this region.

filterSpansback to summary
private void filterSpans(Region ra, Region rb, int flags)
getBoundsback to summary
public void getBounds(int[] pathbox)

Gets the bbox of the available spans, clipped to the OutputArea.

getBoundsIntersectionback to summary
public Region getBoundsIntersection(Rectangle r)

Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified Region object.

The return value may be this same object if no clipping occurs and this Region is rectangular.

getBoundsIntersectionback to summary
public Region getBoundsIntersection(Region r)

Returns a Region object that represents the intersection of this object with the bounds of the specified Region object.

The return value may be this same object or the argument Region object if no clipping occurs and the Regions are rectangular.

getBoundsIntersectionXYWHback to summary
public Region getBoundsIntersectionXYWH(int x, int y, int w, int h)

Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in x, y, width, height format.

The return value may be this same object if no clipping occurs and this Region is rectangular.

getBoundsIntersectionXYXYback to summary
public Region getBoundsIntersectionXYXY(int lox, int loy, int hix, int hiy)

Returns a Region object that represents the bounds of the intersection of this object with the bounds of the specified rectangular area in lox, loy, hix, hiy format.

The return value may be this same object if no clipping occurs and this Region is rectangular.

getDifferenceback to summary
public Region getDifference(Region r)

Returns a Region object that represents the difference of the specified Region object subtracted from this object.

If A and B are both Region Objects and C = A.getDifference(B); then a point will be contained in C iff it is contained in A but not contained in B.

The return value may be this same object or the argument Region object if no clipping occurs.

getExclusiveOrback to summary
public Region getExclusiveOr(Region r)

Returns a Region object that represents the exclusive or of this object with the specified Region object.

If A and B are both Region Objects and C = A.getExclusiveOr(B); then a point will be contained in C iff it is contained in either A or B, but not if it is contained in both.

The return value may be this same object or the argument Region object if either is empty.

getHeightback to summary
public int getHeight()

Returns the height of this Region clipped to the range (0 - MAX_INT).

getHiXback to summary
public int getHiX()

Returns the highest X coordinate in the Region.

getHiYback to summary
public int getHiY()

Returns the highest Y coordinate in the Region.

getInstanceback to summary
public static Region getInstance(Shape s, AffineTransform at)

Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object.

Parameters
s:Shape

a non-null Shape object specifying the geometry enclosing the pixels of interest

at:AffineTransform

an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired

getInstanceback to summary
public static Region getInstance(Region devBounds, Shape s, AffineTransform at)

Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds.

Note that only the bounds of the specified Region are used to restrict the resulting Region. If devBounds is non-rectangular and clipping to the specific bands of devBounds is needed, then an intersection of the resulting Region with devBounds must be performed in a subsequent step.

Parameters
devBounds:Region

a non-null Region specifying some bounds to clip the geometry to

s:Shape

a non-null Shape object specifying the geometry enclosing the pixels of interest

at:AffineTransform

an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired

getInstanceback to summary
public static Region getInstance(Region devBounds, boolean normalize, Shape s, AffineTransform at)

Returns a Region object covering the pixels which would be touched by a fill or clip operation on a Graphics implementation on the specified Shape object under the optionally specified AffineTransform object further restricted by the specified device bounds. If the normalize parameter is true then coordinate normalization is performed as per the 2D Graphics non-antialiasing implementation of the VALUE_STROKE_NORMALIZE hint.

Note that only the bounds of the specified Region are used to restrict the resulting Region. If devBounds is non-rectangular and clipping to the specific bands of devBounds is needed, then an intersection of the resulting Region with devBounds must be performed in a subsequent step.

Parameters
devBounds:Region

a non-null Region specifying some bounds to clip the geometry to

normalize:boolean

a boolean indicating whether or not to apply normalization

s:Shape

a non-null Shape object specifying the geometry enclosing the pixels of interest

at:AffineTransform

an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired

getInstanceback to summary
pack-priv static Region getInstance(final int lox, final int loy, final int hix, final int hiy, final int[] edges)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy and edges array, which is located relative to the rectangular area. Edges array - 0,1 are y range, 2N,2N+1 are x ranges, 1 per y range.

See Also
TransformHelper
getInstanceback to summary
public static Region getInstance(Rectangle r)

Returns a Region object with a rectangle of interest specified by the indicated Rectangle object.

This method can also be used to create a simple rectangular region.

getInstanceback to summary
public static Region getInstance(int[] box)

Returns a Region object with a rectangle of interest specified by the indicated span array.

This method can also be used to create a simple rectangular region.

getInstanceback to summary
public static Region getInstance(int[] box, SpanIterator si)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format.

Appends the list of spans returned from the indicated SpanIterator. Each span must be at a higher starting Y coordinate than the previous data or it must have a Y range equal to the highest Y band in the region and a higher X coordinate than any of the spans in that band.

getInstanceXYWHback to summary
public static Region getInstanceXYWH(int x, int y, int w, int h)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in x, y, width, height format.

This method can also be used to create a simple rectangular region.

getInstanceXYXYback to summary
public static Region getInstanceXYXY(int lox, int loy, int hix, int hiy)

Returns a Region object with a rectangle of interest specified by the indicated rectangular area in lox, loy, hix, hiy format.

This method can also be used to create a simple rectangular region.

getIntersectionback to summary
public Region getIntersection(Rectangle r)

Returns a Region object that represents the intersection of this object with the specified Rectangle. The return value may be this same object if no clipping occurs.

getIntersectionback to summary
public Region getIntersection(final Rectangle2D r)

Returns a Region object that represents the intersection of this object with the specified Rectangle2D. The return value may be this same object if no clipping occurs.

getIntersectionback to summary
public Region getIntersection(Region r)

Returns a Region object that represents the intersection of this object with the specified Region object.

If A and B are both Region Objects and C = A.getIntersection(B); then a point will be contained in C iff it is contained in both A and B.

The return value may be this same object or the argument Region object if no clipping occurs.

getIntersectionXYWHback to summary
public Region getIntersectionXYWH(int x, int y, int w, int h)

Returns a Region object that represents the intersection of this object with the specified rectangular area. The return value may be this same object if no clipping occurs.

getIntersectionXYXYback to summary
public Region getIntersectionXYXY(double lox, double loy, double hix, double hiy)

Returns a Region object that represents the intersection of this object with the specified rectangular area. The return value may be this same object if no clipping occurs.

getIntersectionXYXYback to summary
public Region getIntersectionXYXY(int lox, int loy, int hix, int hiy)

Returns a Region object that represents the intersection of this object with the specified rectangular area. The return value may be this same object if no clipping occurs.

getIteratorback to summary
public RegionIterator getIterator()

Gets an iterator object to iterate over the spans in this region.

getLoXback to summary
public int getLoX()

Returns the lowest X coordinate in the Region.

getLoYback to summary
public int getLoY()

Returns the lowest Y coordinate in the Region.

getSafeTranslatedRegionback to summary
private Region getSafeTranslatedRegion(int dx, int dy)
getScaledRegionback to summary
public Region getScaledRegion(final double sx, final double sy)

Returns a Region object that represents the same list of rectangles as the current Region object, scaled by the specified sx, sy factors.

getSpanIteratorback to summary
public SpanIterator getSpanIterator()

Gets a span iterator object that iterates over the spans in this region

getSpanIteratorback to summary
public SpanIterator getSpanIterator(int[] bbox)

Gets a span iterator object that iterates over the spans in this region but clipped to the bounds given in the argument (xlo, ylo, xhi, yhi).

getTranslatedRegionback to summary
public Region getTranslatedRegion(int dx, int dy)

Returns a Region object that represents the same list of rectangles as the current Region object, translated by the specified dx, dy translation factors.

getUnionback to summary
public Region getUnion(Region r)

Returns a Region object that represents the union of this object with the specified Region object.

If A and B are both Region Objects and C = A.getUnion(B); then a point will be contained in C iff it is contained in either A or B.

The return value may be this same object or the argument Region object if no augmentation occurs.

getWidthback to summary
public int getWidth()

Returns the width of this Region clipped to the range (0 - MAX_INT).

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
initIDsback to summary
private static native void initIDs()
intersectsQuickCheckback to summary
public boolean intersectsQuickCheck(Region r)

Quickly checks if this Region intersects the specified Region object.

This method tests only against the bounds of this region and does not bother to test if the rectangular region actually intersects any bands.

intersectsQuickCheckXYXYback to summary
public boolean intersectsQuickCheckXYXY(int lox, int loy, int hix, int hiy)

Quickly checks if this Region intersects the specified rectangular area specified in lox, loy, hix, hiy format.

This method tests only against the bounds of this region and does not bother to test if the rectangular region actually intersects any bands.

isEmptyback to summary
public boolean isEmpty()

Returns true iff this Region encloses no area.

isInsideQuickCheckback to summary
public boolean isInsideQuickCheck(Region r)

Quickly checks if this Region lies inside the specified Region object.

This method will return false if the specified Region object is not a simple rectangle.

isInsideXYWHback to summary
public boolean isInsideXYWH(int x, int y, int w, int h)

Returns true iff this Region lies inside the indicated rectangular area specified in x, y, width, height format with appropriate clipping performed as per the dimAdd method.

isInsideXYXYback to summary
public boolean isInsideXYXY(int lox, int loy, int hix, int hiy)

Returns true iff this Region lies inside the indicated rectangular area specified in lox, loy, hix, hiy format.

isRectangularback to summary
public boolean isRectangular()

Returns true iff this Region represents a single simple rectangular area.

needSpaceback to summary
private void needSpace(int num)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override