private void retrieveNextPage ( ) { if ( this . pageSize < Long . MAX_VALUE || this . itemLimit < Long . MAX_VALUE ) { this . request . query ( "limit" , Math . min ( this . pageSize , this . itemLimit - this . count ) ) ; } else { this . request . query ( "limit" , null ) ; } ResultBodyCollection < T > page = null ; try { page = this . getNext ( ) ; } catch ( IOException exception ) { // See comments in hasNext(). this . ioException = exception ; } if ( page != null ) { this . continuation = this . getContinuation ( page ) ; if ( page . data != null && ! page . data . isEmpty ( ) ) { this . count += page . data . size ( ) ; this . nextData = page . data ; } else { this . nextData = null ; } } else { this . continuation = null ; this . nextData = null ; } }
Retrieve the next page and store the continuation token the new data and any IOException that may occur .