public static List < List < Object > > buildResults ( Result result , GeoPackageDataType [ ] dataTypes , Integer limit ) { List < List < Object >> results = new ArrayList <> ( ) ; try { int columns = result . getColumnCount ( ) ; while ( result . moveToNext ( ) ) { List < Object > row = new ArrayList <> ( ) ; for ( int i = 0 ; i < columns ; i ++ ) { row . add ( result . getValue ( i , dataTypes != null ? dataTypes [ i ] : null ) ) ; } results . add ( row ) ; if ( limit != null && results . size ( ) >= limit ) { break ; } } } finally { result . close ( ) ; } return results ; }
Build the result rows from the result and the optional limit