private void storeResults ( List < Object > resultKeys ) { if ( resultKeys . size ( ) > queryLimit ) { resultKeys = resultKeys . subList ( 0 , queryLimit ) ; } int keyNumber = 0 ; int pageNumber = 0 ; List < Object > page = new ArrayList < Object > ( ) ; for ( Object key : resultKeys ) { if ( keyNumber % getPageSize ( ) == 0 && keyNumber != 0 ) { storePage ( ++ pageNumber , page ) ; page . clear ( ) ; } page . add ( key ) ; keyNumber ++ ; } if ( page . size ( ) > 0 || pageNumber == 0 ) { storePage ( ++ pageNumber , page ) ; } }
Stores paginated query pages and general info .