# FakeAdaptiveDataSet.Iterator

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/FakeAdaptiveDataSet.java+class:androidx.media3.test.utils.FakeAdaptiveDataSet.Iterator)

*** ** * ** ***


```
public final class FakeAdaptiveDataSet.Iterator extends BaseMediaChunkIterator
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator) ||
|   | ↳ | [androidx.media3.test.utils.FakeAdaptiveDataSet.Iterator](https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet.Iterator) |

*** ** * ** ***

`https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator` for the chunks defined by a fake adaptive data set.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet.Iterator#Iterator(androidx.media3.test.utils.FakeAdaptiveDataSet,int,int)( https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet dataSet, int trackGroupIndex, int chunkIndex )` Create iterator. |

| ### Public methods |
|---|---|
| `long` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet.Iterator#getChunkEndTimeUs()()` Returns the media end time of the chunk, in microseconds. |
| `long` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet.Iterator#getChunkStartTimeUs()()` Returns the media start time of the chunk, in microseconds. |
| `https://developer.android.com/reference/androidx/media3/datasource/DataSpec` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet.Iterator#getDataSpec()()` Returns the `https://developer.android.com/reference/androidx/media3/datasource/DataSpec` used to load the media chunk. |

### Inherited Constants

From [androidx.media3.exoplayer.source.chunk.MediaChunkIterator](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator) `static final https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#EMPTY()`

An empty media chunk iterator without available data.

### Inherited fields

From [androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator) `long` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#currentIndex()`

### Inherited methods

From [androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator) `final void` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#checkInBounds()()`

Verifies that the iterator points to a valid element.
`final long` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#getCurrentIndex()()`

Returns the current index this iterator is pointing to.
`boolean` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#isEnded()()`

Returns whether the iteration has reached the end of the available data.
`boolean` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#next()()`

Moves the iterator to the next media chunk.
`void` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#reset()()`

Resets the iterator to the initial position.
From [androidx.media3.exoplayer.source.chunk.MediaChunkIterator](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator) `int` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#getLocationSteeringPriorityIndex()()`

Returns the index in the steering priority list of the locations (e.g., DASH service location or HLS pathway) for the current media chunks, or `Integer.MAX_VALUE` if steering is inactive or unavailable.

## Public constructors

### Iterator

```
public Iterator(
    FakeAdaptiveDataSet dataSet,
    int trackGroupIndex,
    int chunkIndex
)
```

Create iterator.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet dataSet` | The data set to iterate over. |
| `int trackGroupIndex` | The index of the track group to iterate over. |
| `int chunkIndex` | The chunk index to which the iterator points initially. |

## Public methods

### getChunkEndTimeUs

```
public long getChunkEndTimeUs()
```

Returns the media end time of the chunk, in microseconds.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/util/NoSuchElementException.html` | If the method is called before the first call to `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#next()` or when `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#isEnded()` is true. |

### getChunkStartTimeUs

```
public long getChunkStartTimeUs()
```

Returns the media start time of the chunk, in microseconds.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/util/NoSuchElementException.html` | If the method is called before the first call to `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#next()` or when `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#isEnded()` is true. |

### getDataSpec

```
public DataSpec getDataSpec()
```

Returns the `https://developer.android.com/reference/androidx/media3/datasource/DataSpec` used to load the media chunk.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/util/NoSuchElementException.html` | If the method is called before the first call to `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#next()` or when `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#isEnded()` is true. |