Class NoUidTimeline
- java.lang.Object
-
- com.google.android.exoplayer2.Timeline
-
- com.google.android.exoplayer2.source.ForwardingTimeline
-
- com.google.android.exoplayer2.testutil.NoUidTimeline
-
- All Implemented Interfaces:
Bundleable
public class NoUidTimeline extends ForwardingTimeline
A timeline which wraps another timeline and overrides all window and period uids to 0. This is useful for testing timeline equality without taking uids into account.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.android.exoplayer2.Timeline
Timeline.Period, Timeline.RemotableTimeline, Timeline.Window
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
-
Fields inherited from class com.google.android.exoplayer2.source.ForwardingTimeline
timeline
-
-
Constructor Summary
Constructors Constructor Description NoUidTimeline(Timeline timeline)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Timeline.Period
getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Populates aTimeline.Period
with data for the period at the specified index.Timeline.Window
getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
Populates aTimeline.Window
with data for the window at the specified index.-
Methods inherited from class com.google.android.exoplayer2.source.ForwardingTimeline
getFirstWindowIndex, getIndexOfPeriod, getLastWindowIndex, getNextWindowIndex, getPeriodCount, getPreviousWindowIndex, getUidOfPeriod, getWindowCount
-
Methods inherited from class com.google.android.exoplayer2.Timeline
equals, getNextPeriodIndex, getPeriod, getPeriodByUid, getPeriodPosition, getPeriodPosition, getPeriodPositionUs, getPeriodPositionUs, getWindow, hashCode, isEmpty, isLastPeriod, toBundle, toBundle
-
-
-
-
Constructor Detail
-
NoUidTimeline
public NoUidTimeline(Timeline timeline)
Creates an instance.- Parameters:
timeline
- The underlying timeline.
-
-
Method Detail
-
getWindow
public Timeline.Window getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
Description copied from class:Timeline
Populates aTimeline.Window
with data for the window at the specified index.- Overrides:
getWindow
in classForwardingTimeline
- Parameters:
windowIndex
- The index of the window.window
- TheTimeline.Window
to populate. Must not be null.defaultPositionProjectionUs
- A duration into the future that the populated window's default start position should be projected.- Returns:
- The populated
Timeline.Window
, for convenience.
-
getPeriod
public Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Description copied from class:Timeline
Populates aTimeline.Period
with data for the period at the specified index.- Overrides:
getPeriod
in classForwardingTimeline
- Parameters:
periodIndex
- The index of the period.period
- TheTimeline.Period
to populate. Must not be null.setIds
- WhetherTimeline.Period.id
andTimeline.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:
- The populated
Timeline.Period
, for convenience.
-
-