Stay organized with collections
Save and categorize content based on your preferences.
EntityIterator
public
interface
EntityIterator
implements
Iterator<Entity>
android.content.EntityIterator
|
A specialization of Iterator
that allows iterating over a collection of
Entity
objects. In addition to the iteration functionality it also allows
resetting the iterator back to the beginning and provides for an explicit close()
method to indicate that the iterator is no longer needed and that its resources
can be released.
Summary
Public methods |
abstract
void
|
close()
Indicates that this iterator is no longer needed and that any associated resources
may be released (such as a SQLite cursor).
|
abstract
void
|
reset()
Reset the iterator back to the beginning.
|
Inherited methods |
From interface
java.util.Iterator
default
void
|
forEachRemaining(Consumer<? super E> action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
abstract
boolean
|
hasNext()
Returns true if the iteration has more elements.
|
abstract
Entity
|
next()
Returns the next element in the iteration.
|
default
void
|
remove()
Removes from the underlying collection the last element returned
by this iterator (optional operation).
|
|
Public methods
close
public abstract void close ()
Indicates that this iterator is no longer needed and that any associated resources
may be released (such as a SQLite cursor).
reset
public abstract void reset ()
Reset the iterator back to the beginning.
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,["# EntityIterator\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nEntityIterator\n==============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/content/EntityIterator \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nEntityIterator\n`\n\n\n`\n\n\nimplements\n\n`[Iterator](/reference/java/util/Iterator)`\u003c`[Entity](/reference/android/content/Entity)`\u003e\n\n\n`\n\n|--------------------------------|\n| android.content.EntityIterator |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA specialization of [Iterator](/reference/java/util/Iterator) that allows iterating over a collection of\n[Entity](/reference/android/content/Entity) objects. In addition to the iteration functionality it also allows\nresetting the iterator back to the beginning and provides for an explicit [close()](/reference/android/content/EntityIterator#close())\nmethod to indicate that the iterator is no longer needed and that its resources\ncan be released.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[close](/reference/android/content/EntityIterator#close())`() ` Indicates that this iterator is no longer needed and that any associated resources may be released (such as a SQLite cursor). |\n| ` abstract void` | ` `[reset](/reference/android/content/EntityIterator#reset())`() ` Reset the iterator back to the beginning. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[java.util.Iterator](/reference/java/util/Iterator)` ` |---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` default void` | ` `[forEachRemaining](/reference/java/util/Iterator#forEachRemaining(java.util.function.Consumer\u003c?%20super%20E\u003e))`(`[Consumer](/reference/java/util/function/Consumer)`\u003c? super E\u003e action) ` Performs the given action for each remaining element until all elements have been processed or the action throws an exception. | | ` abstract boolean` | ` `[hasNext](/reference/java/util/Iterator#hasNext())`() ` Returns `true` if the iteration has more elements. | | ` abstract `[Entity](/reference/android/content/Entity) | ` `[next](/reference/java/util/Iterator#next())`() ` Returns the next element in the iteration. | | ` default void` | ` `[remove](/reference/java/util/Iterator#remove())`() ` Removes from the underlying collection the last element returned by this iterator (optional operation). | ||\n\nPublic methods\n--------------\n\n### close\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void close ()\n```\n\nIndicates that this iterator is no longer needed and that any associated resources\nmay be released (such as a SQLite cursor).\n\n\u003cbr /\u003e\n\n### reset\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void reset ()\n```\n\nReset the iterator back to the beginning.\n\n\u003cbr /\u003e"]]