# AbstractConcatenatedTimeline

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

*** ** * ** ***


```
@UnstableApi
public abstract class AbstractConcatenatedTimeline extends Timeline
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.common.Timeline](https://developer.android.com/reference/androidx/media3/common/Timeline) ||
|   | ↳ | [androidx.media3.exoplayer.AbstractConcatenatedTimeline](https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline) |

*** ** * ** ***

Abstract base class for the concatenation of one or more `https://developer.android.com/reference/androidx/media3/common/Timeline`s.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#AbstractConcatenatedTimeline(boolean,androidx.media3.exoplayer.source.ShuffleOrder)( boolean isAtomic, https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder )` Sets up a concatenated timeline with a shuffle order of child timelines. |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getChildPeriodUidFromConcatenatedUid(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html concatenatedUid)` Returns UID of the period in the child timeline from a concatenated period UID. |
| `static https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getChildTimelineUidFromConcatenatedUid(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html concatenatedUid)` Returns UID of child timeline from a concatenated period UID. |
| `static https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getConcatenatedUid(java.lang.Object,java.lang.Object)( https://developer.android.com/reference/java/lang/Object.html childTimelineUid, https://developer.android.com/reference/java/lang/Object.html childPeriodOrWindowUid )` Returns a concatenated UID for a period or window in a child timeline. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getFirstWindowIndex(boolean)(boolean shuffleModeEnabled)` Returns the index of the first window in the playback order depending on whether shuffling is enabled. |
| `final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getIndexOfPeriod(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html uid)` Returns the index of the period identified by its unique `https://developer.android.com/reference/androidx/media3/common/Timeline.Period#uid()`, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if the period is not in the timeline. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getLastWindowIndex(boolean)(boolean shuffleModeEnabled)` Returns the index of the last window in the playback order depending on whether shuffling is enabled. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getNextWindowIndex(int,int,boolean)( int windowIndex, @https://developer.android.com/reference/androidx/media3/common/Player.RepeatMode int repeatMode, boolean shuffleModeEnabled )` Returns the index of the window after the window at index `windowIndex` depending on the `repeatMode` and whether shuffling is enabled. |
| `final https://developer.android.com/reference/androidx/media3/common/Timeline.Period` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getPeriod(int,androidx.media3.common.Timeline.Period,boolean)(int periodIndex, https://developer.android.com/reference/androidx/media3/common/Timeline.Period period, boolean setIds)` Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` with data for the period at the specified index. |
| `final https://developer.android.com/reference/androidx/media3/common/Timeline.Period` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getPeriodByUid(java.lang.Object,androidx.media3.common.Timeline.Period)(https://developer.android.com/reference/java/lang/Object.html periodUid, https://developer.android.com/reference/androidx/media3/common/Timeline.Period period)` Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` with data for the period with the specified unique identifier. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getPreviousWindowIndex(int,int,boolean)( int windowIndex, @https://developer.android.com/reference/androidx/media3/common/Player.RepeatMode int repeatMode, boolean shuffleModeEnabled )` Returns the index of the window before the window at index `windowIndex` depending on the `repeatMode` and whether shuffling is enabled. |
| `final https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getUidOfPeriod(int)(int periodIndex)` Returns the unique id of the period identified by its index in the timeline. |
| `final https://developer.android.com/reference/androidx/media3/common/Timeline.Window` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getWindow(int,androidx.media3.common.Timeline.Window,long)( int windowIndex, https://developer.android.com/reference/androidx/media3/common/Timeline.Window window, long defaultPositionProjectionUs )` Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Window` with data for the window at the specified index. |

| ### Protected methods |
|---|---|
| `abstract int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getChildIndexByChildUid(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html childUid)` Returns the index of the child timeline with the given UID or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if not found. |
| `abstract int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getChildIndexByPeriodIndex(int)(int periodIndex)` Returns the index of the child timeline containing the given period index. |
| `abstract int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getChildIndexByWindowIndex(int)(int windowIndex)` Returns the index of the child timeline containing the given window index. |
| `abstract https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getChildUidByChildIndex(int)(int childIndex)` Returns the UID of the child timeline with the given index. |
| `abstract int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getFirstPeriodIndexByChildIndex(int)(int childIndex)` Returns the first period index belonging to the child timeline with the given index. |
| `abstract int` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getFirstWindowIndexByChildIndex(int)(int childIndex)` Returns the first window index belonging to the child timeline with the given index. |
| `abstract https://developer.android.com/reference/androidx/media3/common/Timeline` | `https://developer.android.com/reference/androidx/media3/exoplayer/AbstractConcatenatedTimeline#getTimelineByChildIndex(int)(int childIndex)` Returns the child timeline for the child with the given index. |

### Inherited Constants

From [androidx.media3.common.Timeline](https://developer.android.com/reference/androidx/media3/common/Timeline) `static final https://developer.android.com/reference/androidx/media3/common/Timeline` `https://developer.android.com/reference/androidx/media3/common/Timeline#EMPTY()`

An empty timeline.

### Inherited methods

From [androidx.media3.common.Timeline](https://developer.android.com/reference/androidx/media3/common/Timeline) `final https://developer.android.com/reference/androidx/media3/common/Timeline` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/androidx/media3/common/Timeline#copyWithSingleWindow(int)(int windowIndex)`

Returns a copy of this timeline containing just the single specified `https://developer.android.com/reference/androidx/media3/common/Timeline.Window`.
`boolean` `https://developer.android.com/reference/androidx/media3/common/Timeline#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` `static https://developer.android.com/reference/androidx/media3/common/Timeline` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[fromBundle](https://developer.android.com/reference/androidx/media3/common/Timeline#fromBundle(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html bundle)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/media3/common/Timeline#fromBundle(android.os.Bundle,int)` instead.

<br />

`static https://developer.android.com/reference/androidx/media3/common/Timeline` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/androidx/media3/common/Timeline#fromBundle(android.os.Bundle,int)(https://developer.android.com/reference/android/os/Bundle.html bundle, int interfaceVersion)`

Restores a `Timeline` from a `https://developer.android.com/reference/android/os/Bundle.html`.
`final int` `https://developer.android.com/reference/androidx/media3/common/Timeline#getNextPeriodIndex(int,androidx.media3.common.Timeline.Period,androidx.media3.common.Timeline.Window,int,boolean)(
int periodIndex,
https://developer.android.com/reference/androidx/media3/common/Timeline.Period period,
https://developer.android.com/reference/androidx/media3/common/Timeline.Window window,
@https://developer.android.com/reference/androidx/media3/common/Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled
)`

Returns the index of the period after the period at index `periodIndex` depending on the `repeatMode` and whether shuffling is enabled.
`final https://developer.android.com/reference/androidx/media3/common/Timeline.Period` `https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriod(int,androidx.media3.common.Timeline.Period)(int periodIndex, https://developer.android.com/reference/androidx/media3/common/Timeline.Period period)`

Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` with data for the period at the specified index.
`abstract int` `https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodCount()()`

Returns the number of periods in the timeline.
`final https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Object.html, https://developer.android.com/reference/java/lang/Long.html>` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
@https://checkerframework.org/api/com/google/errorprone/annotations/InlineMe.html(replacement = "this.getPeriodPositionUs(window, period, windowIndex, windowPositionUs)")
[getPeriodPosition](https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodPosition(androidx.media3.common.Timeline.Window,androidx.media3.common.Timeline.Period,int,long))(
https://developer.android.com/reference/androidx/media3/common/Timeline.Window window,
https://developer.android.com/reference/androidx/media3/common/Timeline.Period period,
int windowIndex,
long windowPositionUs
)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodPositionUs(androidx.media3.common.Timeline.Window,androidx.media3.common.Timeline.Period,int,long)` instead.

<br />

`final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Object.html, https://developer.android.com/reference/java/lang/Long.html>` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
@https://checkerframework.org/api/com/google/errorprone/annotations/InlineMe.html(replacement = "this.getPeriodPositionUs("
+ "window, period, windowIndex, windowPositionUs, defaultPositionProjectionUs)")
[getPeriodPosition](https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodPosition(androidx.media3.common.Timeline.Window,androidx.media3.common.Timeline.Period,int,long,long))(
https://developer.android.com/reference/androidx/media3/common/Timeline.Window window,
https://developer.android.com/reference/androidx/media3/common/Timeline.Period period,
int windowIndex,
long windowPositionUs,
long defaultPositionProjectionUs
)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodPositionUs(androidx.media3.common.Timeline.Window,androidx.media3.common.Timeline.Period,int,long,long)` instead.

<br />

`final https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Object.html, https://developer.android.com/reference/java/lang/Long.html>` `https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodPositionUs(androidx.media3.common.Timeline.Window,androidx.media3.common.Timeline.Period,int,long)(
https://developer.android.com/reference/androidx/media3/common/Timeline.Window window,
https://developer.android.com/reference/androidx/media3/common/Timeline.Period period,
int windowIndex,
long windowPositionUs
)`

Calls `https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodPositionUs(androidx.media3.common.Timeline.Window,androidx.media3.common.Timeline.Period,int,long)` with a zero default position projection.
`final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Object.html, https://developer.android.com/reference/java/lang/Long.html>` `https://developer.android.com/reference/androidx/media3/common/Timeline#getPeriodPositionUs(androidx.media3.common.Timeline.Window,androidx.media3.common.Timeline.Period,int,long,long)(
https://developer.android.com/reference/androidx/media3/common/Timeline.Window window,
https://developer.android.com/reference/androidx/media3/common/Timeline.Period period,
int windowIndex,
long windowPositionUs,
long defaultPositionProjectionUs
)`

Converts `(windowIndex, windowPositionUs)` to the corresponding `(periodUid,
periodPositionUs)`.
`final https://developer.android.com/reference/androidx/media3/common/Timeline.Window` `https://developer.android.com/reference/androidx/media3/common/Timeline#getWindow(int,androidx.media3.common.Timeline.Window)(int windowIndex, https://developer.android.com/reference/androidx/media3/common/Timeline.Window window)`

Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Window` with data for the window at the specified index.
`abstract int` `https://developer.android.com/reference/androidx/media3/common/Timeline#getWindowCount()()`

Returns the number of windows in the timeline.
`int` `https://developer.android.com/reference/androidx/media3/common/Timeline#hashCode()()` `final boolean` `https://developer.android.com/reference/androidx/media3/common/Timeline#isEmpty()()`

Returns whether the timeline is empty.
`final boolean` `https://developer.android.com/reference/androidx/media3/common/Timeline#isLastPeriod(int,androidx.media3.common.Timeline.Period,androidx.media3.common.Timeline.Window,int,boolean)(
int periodIndex,
https://developer.android.com/reference/androidx/media3/common/Timeline.Period period,
https://developer.android.com/reference/androidx/media3/common/Timeline.Window window,
@https://developer.android.com/reference/androidx/media3/common/Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled
)`

Returns whether the given period is the last period of the timeline depending on the `
repeatMode` and whether shuffling is enabled.
`final https://developer.android.com/reference/android/os/Bundle.html` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[toBundle](https://developer.android.com/reference/androidx/media3/common/Timeline#toBundle())()`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/media3/common/Timeline#toBundle(int)` instead.

<br />

`final https://developer.android.com/reference/android/os/Bundle.html` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/androidx/media3/common/Timeline#toBundle(int)(int interfaceVersion)`

Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this object.

## Public constructors

### AbstractConcatenatedTimeline

```
public AbstractConcatenatedTimeline(
    boolean isAtomic,
    ShuffleOrder shuffleOrder
)
```

Sets up a concatenated timeline with a shuffle order of child timelines.

| Parameters |
|---|---|
| `boolean isAtomic` | Whether the child timelines shall be treated as atomic, i.e., treated as a single item for repeating and shuffling. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder` | A shuffle order of child timelines. The number of child timelines must match the number of elements in the shuffle order. |

## Public methods

### getChildPeriodUidFromConcatenatedUid

```
public static Object getChildPeriodUidFromConcatenatedUid(Object concatenatedUid)
```

Returns UID of the period in the child timeline from a concatenated period UID.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html concatenatedUid` | UID of a period in a concatenated timeline. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html` | UID of the period in the child timeline. |

### getChildTimelineUidFromConcatenatedUid

```
public static Object getChildTimelineUidFromConcatenatedUid(Object concatenatedUid)
```

Returns UID of child timeline from a concatenated period UID.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html concatenatedUid` | UID of a period in a concatenated timeline. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html` | UID of the child timeline this period belongs to. |

### getConcatenatedUid

```
public static Object getConcatenatedUid(
    Object childTimelineUid,
    Object childPeriodOrWindowUid
)
```

Returns a concatenated UID for a period or window in a child timeline.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html childTimelineUid` | UID of the child timeline this period or window belongs to. |
| `https://developer.android.com/reference/java/lang/Object.html childPeriodOrWindowUid` | UID of the period or window in the child timeline. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html` | UID of the period or window in the concatenated timeline. |

### getFirstWindowIndex

```
public int getFirstWindowIndex(boolean shuffleModeEnabled)
```

Returns the index of the first window in the playback order depending on whether shuffling is enabled.

| Parameters |
|---|---|
| `boolean shuffleModeEnabled` | Whether shuffling is enabled. |

| Returns |
|---|---|
| `int` | The index of the first window in the playback order, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if the timeline is empty. |

### getIndexOfPeriod

```
public final int getIndexOfPeriod(Object uid)
```

Returns the index of the period identified by its unique `https://developer.android.com/reference/androidx/media3/common/Timeline.Period#uid()`, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if the period is not in the timeline.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html uid` | A unique identifier for a period. |

| Returns |
|---|---|
| `int` | The index of the period, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if the period was not found. |

### getLastWindowIndex

```
public int getLastWindowIndex(boolean shuffleModeEnabled)
```

Returns the index of the last window in the playback order depending on whether shuffling is enabled.

| Parameters |
|---|---|
| `boolean shuffleModeEnabled` | Whether shuffling is enabled. |

| Returns |
|---|---|
| `int` | The index of the last window in the playback order, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if the timeline is empty. |

### getNextWindowIndex

```
public int getNextWindowIndex(
    int windowIndex,
    @Player.RepeatMode int repeatMode,
    boolean shuffleModeEnabled
)
```

Returns the index of the window after the window at index `windowIndex` depending on the `repeatMode` and whether shuffling is enabled.

| Parameters |
|---|---|
| `int windowIndex` | Index of a window in the timeline. |
| `@https://developer.android.com/reference/androidx/media3/common/Player.RepeatMode int repeatMode` | A repeat mode. |
| `boolean shuffleModeEnabled` | Whether shuffling is enabled. |

| Returns |
|---|---|
| `int` | The index of the next window, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if this is the last window. |

### getPeriod

```
public final Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
```

Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` with data for the period at the specified index.

| Parameters |
|---|---|
| `int periodIndex` | The index of the period. |
| `https://developer.android.com/reference/androidx/media3/common/Timeline.Period period` | The `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` to populate. Must not be null. |
| `boolean setIds` | Whether `https://developer.android.com/reference/androidx/media3/common/Timeline.Period#id()` and `https://developer.android.com/reference/androidx/media3/common/Timeline.Period#uid()` should be populated. If false, the fields will be set to null. The caller should pass false for efficiency reasons unless the fields are required. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` | The populated `https://developer.android.com/reference/androidx/media3/common/Timeline.Period`, for convenience. |

### getPeriodByUid

```
public final Timeline.Period getPeriodByUid(Object periodUid, Timeline.Period period)
```

Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` with data for the period with the specified unique identifier.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html periodUid` | The unique identifier of the period. |
| `https://developer.android.com/reference/androidx/media3/common/Timeline.Period period` | The `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` to populate. Must not be null. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Timeline.Period` | The populated `https://developer.android.com/reference/androidx/media3/common/Timeline.Period`, for convenience. |

### getPreviousWindowIndex

```
public int getPreviousWindowIndex(
    int windowIndex,
    @Player.RepeatMode int repeatMode,
    boolean shuffleModeEnabled
)
```

Returns the index of the window before the window at index `windowIndex` depending on the `repeatMode` and whether shuffling is enabled.

| Parameters |
|---|---|
| `int windowIndex` | Index of a window in the timeline. |
| `@https://developer.android.com/reference/androidx/media3/common/Player.RepeatMode int repeatMode` | A repeat mode. |
| `boolean shuffleModeEnabled` | Whether shuffling is enabled. |

| Returns |
|---|---|
| `int` | The index of the previous window, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if this is the first window. |

### getUidOfPeriod

```
public final Object getUidOfPeriod(int periodIndex)
```

Returns the unique id of the period identified by its index in the timeline.

| Parameters |
|---|---|
| `int periodIndex` | The index of the period. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html` | The unique id of the period. |

### getWindow

```
public final Timeline.Window getWindow(
    int windowIndex,
    Timeline.Window window,
    long defaultPositionProjectionUs
)
```

Populates a `https://developer.android.com/reference/androidx/media3/common/Timeline.Window` with data for the window at the specified index.

| Parameters |
|---|---|
| `int windowIndex` | The index of the window. |
| `https://developer.android.com/reference/androidx/media3/common/Timeline.Window window` | The `https://developer.android.com/reference/androidx/media3/common/Timeline.Window` to populate. Must not be null. |
| `long defaultPositionProjectionUs` | A duration into the future that the populated window's default start position should be projected. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Timeline.Window` | The populated `https://developer.android.com/reference/androidx/media3/common/Timeline.Window`, for convenience. |

## Protected methods

### getChildIndexByChildUid

```
protected abstract int getChildIndexByChildUid(Object childUid)
```

Returns the index of the child timeline with the given UID or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if not found.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html childUid` | A child UID. |

| Returns |
|---|---|
| `int` | Index of child timeline or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if UID was not found. |

### getChildIndexByPeriodIndex

```
protected abstract int getChildIndexByPeriodIndex(int periodIndex)
```

Returns the index of the child timeline containing the given period index.

| Parameters |
|---|---|
| `int periodIndex` | A valid period index within the bounds of the timeline. |

### getChildIndexByWindowIndex

```
protected abstract int getChildIndexByWindowIndex(int windowIndex)
```

Returns the index of the child timeline containing the given window index.

| Parameters |
|---|---|
| `int windowIndex` | A valid window index within the bounds of the timeline. |

### getChildUidByChildIndex

```
protected abstract Object getChildUidByChildIndex(int childIndex)
```

Returns the UID of the child timeline with the given index.

| Parameters |
|---|---|
| `int childIndex` | A valid child index within the bounds of the timeline. |

### getFirstPeriodIndexByChildIndex

```
protected abstract int getFirstPeriodIndexByChildIndex(int childIndex)
```

Returns the first period index belonging to the child timeline with the given index.

| Parameters |
|---|---|
| `int childIndex` | A valid child index within the bounds of the timeline. |

### getFirstWindowIndexByChildIndex

```
protected abstract int getFirstWindowIndexByChildIndex(int childIndex)
```

Returns the first window index belonging to the child timeline with the given index.

| Parameters |
|---|---|
| `int childIndex` | A valid child index within the bounds of the timeline. |

### getTimelineByChildIndex

```
protected abstract Timeline getTimelineByChildIndex(int childIndex)
```

Returns the child timeline for the child with the given index.

| Parameters |
|---|---|
| `int childIndex` | A valid child index within the bounds of the timeline. |