FileDocCategorySizeDatePackage
RegionIterator.javaAPI DocAndroid 1.5 API1838Wed May 06 22:42:00 BST 2009android.graphics

RegionIterator

public class RegionIterator extends Object

Fields Summary
private final int
mNativeIter
Constructors Summary
public RegionIterator(Region region)
Construct an iterator for all of the rectangles in a region. This effectively makes a private copy of the region, so any subsequent edits to region will not affect the iterator.

param
region the region that will be iterated

        mNativeIter = nativeConstructor(region.ni());
    
Methods Summary
protected voidfinalize()

        nativeDestructor(mNativeIter);
    
private static native intnativeConstructor(int native_region)

private static native voidnativeDestructor(int native_iter)

private static native booleannativeNext(int native_iter, Rect r)

public final booleannext(Rect r)
Return the next rectangle in the region. If there are no more rectangles this returns false and r is unchanged. If there is at least one more, this returns true and r is set to that rectangle.

        if (r == null) {
            throw new NullPointerException("The Rect must be provided");
        }
        return nativeNext(mNativeIter, r);