class SinglePeriodTimeline extends Timeline {

  @Override
  public Window getWindow(
      int windowIndex, Window window, boolean setTag, long defaultPositionProjectionUs) {
    Assertions.checkIndex(windowIndex, 0, 1);
    Object tag = setTag ? this.tag : null;
    long windowDefaultStartPositionUs = this.windowDefaultStartPositionUs;
    if (isDynamic && defaultPositionProjectionUs != 0) {
      if (windowDurationUs == C.TIME_UNSET) {
        // Don't allow projection into a window that has an unknown duration.
        windowDefaultStartPositionUs = C.TIME_UNSET;
      } else {
        windowDefaultStartPositionUs += defaultPositionProjectionUs;
        if (windowDefaultStartPositionUs > windowDurationUs) {
          // The projection takes us beyond the end of the window.
          windowDefaultStartPositionUs = C.TIME_UNSET;
        }
      }
    }
    return window.set(
        tag,
        presentationStartTimeMs,
        windowStartTimeMs,
        isSeekable,
        isDynamic,
        windowDefaultStartPositionUs,
        windowDurationUs,
        0,
        0,
        windowPositionInPeriodUs);
  }

  public  SinglePeriodTimeline(long durationUs, boolean isSeekable, boolean isDynamic);
  public  SinglePeriodTimeline(
      long durationUs, boolean isSeekable, boolean isDynamic, @Nullable Object tag);
  public  SinglePeriodTimeline(
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag);
  public  SinglePeriodTimeline(
      long presentationStartTimeMs,
      long windowStartTimeMs,
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag);

}