T
- The domain object type stored in this list.public abstract class PaginatedList<T>
extends java.lang.Object
implements java.util.List<T>
Pages of results are fetched lazily from DynamoDB as they are needed. Some
methods, such as size()
and
toArray()
, require fetching the entire result set
eagerly. See the javadoc of individual methods for details on which are lazy.
Constructor and Description |
---|
PaginatedList(DynamoDBMapper mapper,
java.lang.Class<T> clazz,
AmazonDynamoDB dynamo)
Constructs a PaginatedList instance using the default
PaginationLoadingStrategy
|
PaginatedList(DynamoDBMapper mapper,
java.lang.Class<T> clazz,
AmazonDynamoDB dynamo,
DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
Constructs a PaginatedList instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int arg0,
T arg1) |
boolean |
add(T arg0) |
boolean |
addAll(java.util.Collection<? extends T> arg0) |
boolean |
addAll(int arg0,
java.util.Collection<? extends T> arg1) |
void |
clear() |
boolean |
contains(java.lang.Object arg0)
Returns whether the collection contains the given element.
|
boolean |
containsAll(java.util.Collection<?> arg0) |
T |
get(int n)
Returns the Nth element of the list.
|
int |
indexOf(java.lang.Object arg0)
Returns the first index of the object given in the list.
|
boolean |
isEmpty()
Returns whether the collection is empty.
|
java.util.Iterator<T> |
iterator()
Returns an iterator over this list that lazily initializes results as
necessary.
|
int |
lastIndexOf(java.lang.Object arg0) |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int arg0) |
void |
loadAllResults()
Eagerly loads all results for this list.
|
T |
remove(int arg0) |
boolean |
remove(java.lang.Object arg0) |
boolean |
removeAll(java.util.Collection<?> arg0) |
boolean |
retainAll(java.util.Collection<?> arg0) |
T |
set(int arg0,
T arg1) |
int |
size() |
java.util.List<T> |
subList(int arg0,
int arg1)
Returns a sub-list in the range specified, loading more results as
necessary.
|
java.lang.Object[] |
toArray() |
<X> X[] |
toArray(X[] a) |
public PaginatedList(DynamoDBMapper mapper, java.lang.Class<T> clazz, AmazonDynamoDB dynamo)
mapper
- the DynamoDBMapper
clazz
- the class that is being mapped to a table.dynamo
- the instance of AmazonDynamoDB
public PaginatedList(DynamoDBMapper mapper, java.lang.Class<T> clazz, AmazonDynamoDB dynamo, DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
mapper
- The mapper for marshalling DynamoDB attributes into
objects.clazz
- The class of the annotated model.dynamo
- The DynamoDB client for making low-level request calls.paginationLoadingStrategy
- The strategy used for loading paginated
results. Caller has to explicitly set this parameter, since
the DynamoDBMapperConfig set in the mapper is not accessible
here. If null value is provided, LAZY_LOADING will be set by
default.public void loadAllResults()
Not supported in ITERATION_ONLY mode.
public java.util.Iterator<T> iterator()
If it configured with ITERARTION_ONLY mode, then the iterator could be only retrieved once, and any previously loaded results will be cleared in the memory during the iteration.
public boolean isEmpty()
Not supported in ITERATION_ONLY mode.
public T get(int n)
Not supported in ITERATION_ONLY mode.
get
in interface java.util.List<T>
public boolean contains(java.lang.Object arg0)
Not supported in ITERATION_ONLY mode.
public java.util.List<T> subList(int arg0, int arg1)
Not supported in ITERATION_ONLY mode.
subList
in interface java.util.List<T>
public int indexOf(java.lang.Object arg0)
Not supported in ITERATION_ONLY mode.
indexOf
in interface java.util.List<T>
public int size()
public boolean containsAll(java.util.Collection<?> arg0)
public int lastIndexOf(java.lang.Object arg0)
lastIndexOf
in interface java.util.List<T>
public java.lang.Object[] toArray()
public <X> X[] toArray(X[] a)
public java.util.ListIterator<T> listIterator()
listIterator
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator(int arg0)
listIterator
in interface java.util.List<T>
public boolean remove(java.lang.Object arg0)
public boolean removeAll(java.util.Collection<?> arg0)
public boolean retainAll(java.util.Collection<?> arg0)
public boolean add(T arg0)
public boolean addAll(java.util.Collection<? extends T> arg0)
public boolean addAll(int arg0, java.util.Collection<? extends T> arg1)
addAll
in interface java.util.List<T>
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.