FileDocCategorySizeDatePackage
RegionIterator.javaAPI DocAndroid 5.1 API1839Thu Mar 12 22:22:30 GMT 2015android.graphics

RegionIterator

public class RegionIterator extends Object

Fields Summary
private final long
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 longnativeConstructor(long native_region)

private static native voidnativeDestructor(long native_iter)

private static native booleannativeNext(long 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);