# EntityIterator

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/android/content/EntityIterator#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/content/EntityIterator#inhmethods)  

# EntityIterator

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/content/EntityIterator "View this page in Kotlin")\|Java

`
public


interface
EntityIterator
`  
`


implements

`[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[Entity](https://developer.android.com/reference/android/content/Entity)`>


`

|--------------------------------|
| android.content.EntityIterator |

<br />

*** ** * ** ***

A specialization of[Iterator](https://developer.android.com/reference/java/util/Iterator)that allows iterating over a collection of[Entity](https://developer.android.com/reference/android/content/Entity)objects. In addition to the iteration functionality it also allows resetting the iterator back to the beginning and provides for an explicit[close()](https://developer.android.com/reference/android/content/EntityIterator#close())method to indicate that the iterator is no longer needed and that its resources can be released.

## Summary

|                                                                                                               ### Public methods                                                                                                                ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[close](https://developer.android.com/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). |
| ` abstract void` | ` `[reset](https://developer.android.com/reference/android/content/EntityIterator#reset())`() ` Reset the iterator back to the beginning.                                                                                     |

| ### Inherited methods |
|-----------------------|---|
| From interface` `[java.util.Iterator](https://developer.android.com/reference/java/util/Iterator)` ` |--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` default void`                                                                      | ` `[forEachRemaining](https://developer.android.com/reference/java/util/Iterator#forEachRemaining(java.util.function.Consumer<?%20super%20E>))`(`[Consumer](https://developer.android.com/reference/java/util/function/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](https://developer.android.com/reference/java/util/Iterator#hasNext())`() ` Returns`true`if the iteration has more elements.                                                                                                                                                                                                                                              | | ` abstract `[Entity](https://developer.android.com/reference/android/content/Entity) | ` `[next](https://developer.android.com/reference/java/util/Iterator#next())`() ` Returns the next element in the iteration.                                                                                                                                                                                                                                                          | | ` default void`                                                                      | ` `[remove](https://developer.android.com/reference/java/util/Iterator#remove())`() ` Removes from the underlying collection the last element returned by this iterator (optional operation).                                                                                                                                                                                         | ||

## Public methods

### close

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
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).

<br />

### reset

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void reset ()
```

Reset the iterator back to the beginning.

<br />