Stay organized with collections
Save and categorize content based on your preferences.
RegionIterator
open class RegionIterator
Summary
Public constructors |
Construct an iterator for all of the rectangles in a region.
|
Public methods |
Boolean |
Return the next rectangle in the region.
|
Protected methods |
open Unit |
|
Public constructors
RegionIterator
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 |
Region!: the region that will be iterated |
Public methods
next
fun next(r: Rect!): Boolean
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
finalize
protected open fun finalize(): Unit
Exceptions |
java.lang.Throwable |
the Exception raised by this method |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# RegionIterator\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRegionIterator\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/RegionIterator \"View this page in Java\") \n\n```\nopen class RegionIterator\n```\n\n|---|--------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.graphics.RegionIterator](#) |\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [RegionIterator](#RegionIterator(android.graphics.Region))`(`region:` `[Region](/reference/kotlin/android/graphics/Region)!`)` Construct an iterator for all of the rectangles in a region. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [next](#next(android.graphics.Rect))`(`r:` `[Rect](/reference/kotlin/android/graphics/Rect)!`)` Return the next rectangle in the region. |\n\n| Protected methods ||\n|-----------------------------------------------------------------------------------|------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [finalize](#finalize())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### RegionIterator\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nRegionIterator(region: Region!)\n```\n\nConstruct 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.\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------|\n| `region` | [Region](/reference/kotlin/android/graphics/Region)!: the region that will be iterated |\n\nPublic methods\n--------------\n\n### next\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun next(r: Rect!): Boolean\n```\n\nReturn 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.\n\nProtected methods\n-----------------\n\n### finalize\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected open fun finalize(): Unit\n```\n\n| Exceptions ||\n|-----------------------|---------------------------------------|\n| `java.lang.Throwable` | the `Exception` raised by this method |"]]