public class

RegionIterator

extends Object
java.lang.Object
   ↳ android.graphics.RegionIterator

Summary

Public Constructors
RegionIterator(Region region)
Construct an iterator for all of the rectangles in a region.
Public Methods
final boolean next(Rect r)
Return the next rectangle in the region.
Protected Methods
void finalize()
Is called before the object's memory is being reclaimed by the VM.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

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.

Parameters
region the region that will be iterated

Public Methods

public final boolean next (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.

Protected Methods

protected void finalize ()

Is called before the object's memory is being reclaimed by the VM. This can only happen once the VM has detected, during a run of the garbage collector, that the object is no longer reachable by any thread of the running application.

The method can be used to free system resources or perform other cleanup before the object is garbage collected. The default implementation of the method is empty, which is also expected by the VM, but subclasses can override finalize() as required. Uncaught exceptions which are thrown during the execution of this method cause it to terminate immediately but are otherwise ignored.

Note that the VM does guarantee that finalize() is called at most once for any object, but it doesn't guarantee when (if at all) finalize() will be called. For example, object B's finalize() can delay the execution of object A's finalize() method and therefore it can delay the reclamation of A's memory. To be safe, use a ReferenceQueue, because it provides more control over the way the VM deals with references during garbage collection.

Throws
Throwable