Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2014-2015, Inc. or its affiliates. All Rights Reserved.
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
 * or in the "license" file accompanying this file. This file is distributed
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
A page contains a list of items; accessing methods on the list are guaranteed to be purely in-memory operations that will not block or throw exceptions because of transient network issues. A page also knows whether it has a "next page", and if so knows how to retrieve it (which will almost certainly involve a remote network call that may block or fail).

<T> item type
<R> low level result type
public abstract class Page<T,R> implements Iterable<T> {
    private final List<T> content;
    private final R lowLevelResult;

Checks whether this page has a "next page." If this method returns true, the next page can be retrieved by calling next. If it returns false, any call to next will be guaranteed to throw an IllegalStateException.

true if there is next page; false otherwise
    public abstract boolean hasNextPage();

Retrieves the next page.

the next page
java.util.NoSuchElementException if there is no next page
com.amazonaws.AmazonServiceException on error making the remote call
    public abstract Page<T,R> nextPage();


content an unmodifiable list of content
lowLevelResult the low level (response) result from AWSS
    public Page(List<T> content, R lowLevelResult) {
        if (content == null || lowLevelResult == null)
            throw new IllegalArgumentException("both content and lowLevelResult must be specified");
        this. = content;
        this. = lowLevelResult;
    public final int size() {
        return .size();
    public final Iterator<T> iterator() {
        return .iterator();
    public String toString() {
        return .toString();
    public final R getLowLevelResult() {
        return ;
New to GrepCode? Check out our FAQ X