summaryrefslogtreecommitdiff
path: root/android/arch/paging/PositionalDataSource.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/arch/paging/PositionalDataSource.java')
-rw-r--r--android/arch/paging/PositionalDataSource.java25
1 files changed, 10 insertions, 15 deletions
diff --git a/android/arch/paging/PositionalDataSource.java b/android/arch/paging/PositionalDataSource.java
index c538cb60..deb51e94 100644
--- a/android/arch/paging/PositionalDataSource.java
+++ b/android/arch/paging/PositionalDataSource.java
@@ -42,17 +42,6 @@ import java.util.List;
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class PositionalDataSource<Value> extends ContiguousDataSource<Integer, Value> {
-
- /**
- * Number of items that this DataSource can provide in total, or COUNT_UNDEFINED.
- *
- * @return number of items that this DataSource can provide in total, or COUNT_UNDEFINED
- * if difficult or undesired to compute.
- */
- public int countItems() {
- return COUNT_UNDEFINED;
- }
-
@Nullable
@Override
List<Value> loadAfterImpl(int currentEndIndex, @NonNull Value currentEndItem, int pageSize) {
@@ -66,7 +55,16 @@ public abstract class PositionalDataSource<Value> extends ContiguousDataSource<I
return loadBefore(currentBeginIndex - 1, pageSize);
}
- /** @hide */
+
+ /**
+ * Load initial data, starting after the passed position.
+ *
+ * @param position Index just before the data to be loaded.
+ * @param initialLoadSize Suggested number of items to load.
+ * @return List of initial items, representing data starting at position. Null if the
+ * DataSource is no longer valid, and should not be queried again.
+ * @hide
+ */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@WorkerThread
@Nullable
@@ -120,9 +118,6 @@ public abstract class PositionalDataSource<Value> extends ContiguousDataSource<I
@Override
Integer getKey(int position, Value item) {
- if (position < 0) {
- return null;
- }
return position;
}
}