Rabbit-R1/android (non root)/java/sources/androidx/media3/exoplayer/offline/DownloadCursor.java
2024-05-21 17:08:36 -04:00

52 lines
1.1 KiB
Java

package androidx.media3.exoplayer.offline;
import java.io.Closeable;
/* loaded from: classes2.dex */
public interface DownloadCursor extends Closeable {
@Override // java.io.Closeable, java.lang.AutoCloseable
void close();
int getCount();
Download getDownload();
int getPosition();
boolean isClosed();
boolean moveToPosition(int i);
default boolean moveToFirst() {
return moveToPosition(0);
}
default boolean moveToLast() {
return moveToPosition(getCount() - 1);
}
default boolean moveToNext() {
return moveToPosition(getPosition() + 1);
}
default boolean moveToPrevious() {
return moveToPosition(getPosition() - 1);
}
default boolean isFirst() {
return getPosition() == 0 && getCount() != 0;
}
default boolean isLast() {
int count = getCount();
return getPosition() == count + (-1) && count != 0;
}
default boolean isBeforeFirst() {
return getCount() == 0 || getPosition() == -1;
}
default boolean isAfterLast() {
return getCount() == 0 || getPosition() == getCount();
}
}