Class TableCollection<R>

  • Type Parameters:
    R - low level result type
    All Implemented Interfaces:
    Iterable<Table>

    public abstract class TableCollection<R>
    extends com.amazonaws.services.dynamodbv2.document.internal.PageBasedCollection<Table,​R>
    A collection of Table's (initialized with the respective table names). An TableCollection object maintains a cursor pointing to its current pages of data. Initially the cursor is positioned before the first page. The next method moves the cursor to the next row, and because it returns false when there are no more rows in the TableCollection object, it can be used in a while loop to iterate through the collection. Network calls can be triggered when the collection is iterated across page boundaries.
    • Constructor Detail

      • TableCollection

        public TableCollection()
    • Method Detail

      • pages

        public com.amazonaws.services.dynamodbv2.document.internal.PageIterable<Table,​R> pages()
        Returns an Iterable<Page<Table, R>> that iterates over pages of tables from this collection. Each call to Iterator.next on an Iterator returned from this Iterable results in exactly one call to DynamoDB to retrieve a single page of results.

        TableCollection<?> collection = ...; for (Page<Table> page : collection.pages()) { processTables(page); }

        The use of the internal/undocumented PageIterable class instead of Iterable in the public interface here is retained for backwards compatibility. It doesn't expose any methods beyond those of the Iterable interface. This method will be changed to return an Iterable<Page<Table, R>> directly in a future release of the SDK.

        Overrides:
        pages in class com.amazonaws.services.dynamodbv2.document.internal.PageBasedCollection<Table,​R>
        See Also:
        Page
      • getMaxResultSize

        public abstract Integer getMaxResultSize()
        Returns the maximum number of resources to be retrieved in this collection; or null if there is no limit.
        Specified by:
        getMaxResultSize in class com.amazonaws.services.dynamodbv2.document.internal.PageBasedCollection<Table,​R>
      • getLastLowLevelResult

        public R getLastLowLevelResult()
        Returns the low-level result last retrieved (for the current page) from the server side; or null if there has yet no calls to the server.
        Overrides:
        getLastLowLevelResult in class com.amazonaws.services.dynamodbv2.document.internal.PageBasedCollection<Table,​R>
      • registerLowLevelResultListener

        public LowLevelResultListener<R> registerLowLevelResultListener​(LowLevelResultListener<R> listener)
        Used to register a listener for the event of receiving a low-level result from the server side.
        Overrides:
        registerLowLevelResultListener in class com.amazonaws.services.dynamodbv2.document.internal.PageBasedCollection<Table,​R>
        Parameters:
        listener - listener to be registered. If null, a "none" listener will be set.
        Returns:
        the previously registered listener. The return value is never null.