@SuppressWarnings({"rawtypes","unchecked"}) public Result pageResult(int startCount,int endCount,String step){
  List<String> fields=new ArrayList<String>();
  List values=new ArrayList<String>();
  fields.add(RESULT_FLAG);
  values.add(operationCompletedSuccessfully);
  fields.add(QUERY_PAGE_START);
  values.add(startCount);
  fields.add(QUERY_PAGE_END);
  values.add(endCount);
  if (errorString != null) {
    fields.add("Message");
    values.add(errorString);
    return createBannerResult(fields,values,step);
  }
 else {
    if (infoString != null) {
      fields.add("Message");
      values.add(infoString);
    }
    if (selectResult != null) {
      try {
        TabularResultData table=ResultBuilder.createTabularResultData();
        String[] headers=null;
        Object[][] rows=null;
        int rowCount=buildTable(table,startCount,endCount);
        GfJsonArray array=table.getHeaders();
        headers=new String[array.size()];
        rows=new Object[rowCount][array.size()];
        for (int i=0; i < array.size(); i++) {
          headers[i]=(String)array.get(i);
          List<String> list=table.retrieveAllValues(headers[i]);
          for (int j=0; j < list.size(); j++) {
            rows[j][i]=list.get(j);
          }
        }
        fields.add(NUM_ROWS);
        values.add((selectResult == null) ? 0 : selectResult.size());
        if (queryTraceString != null) {
          fields.add(QUERY_TRACE);
          values.add(queryTraceString);
        }
        return createPageResult(fields,values,step,headers,rows);
      }
 catch (      GfJsonException e) {
        String[] headers=new String[]{"Error"};
        Object[][] rows={{e.getMessage()}};
        String fieldsArray[]={QUERY_PAGE_START,QUERY_PAGE_END};
        Object valuesArray[]={startCount,endCount};
        return createPageResult(fieldsArray,valuesArray,step,headers,rows);
      }
    }
 else     return createBannerResult(fields,values,step);
  }
}

@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public Result pageResult ( int startCount , int endCount , String step ) { List < String > fields = new ArrayList < String > ( ) ; List values = new ArrayList < String > ( ) ; fields . add ( RESULT_FLAG ) ; values . add ( operationCompletedSuccessfully ) ; fields . add ( QUERY_PAGE_START ) ; values . add ( startCount ) ; fields . add ( QUERY_PAGE_END ) ; values . add ( endCount ) ; if ( errorString != null ) { fields . add ( "Message" ) ; values . add ( errorString ) ; return createBannerResult ( fields , values , step ) ; } else { if ( infoString != null ) { fields . add ( "Message" ) ; values . add ( infoString ) ; } if ( selectResult != null ) { try { TabularResultData table = ResultBuilder . createTabularResultData ( ) ; String [ ] headers = null ; Object [ ] [ ] rows = null ; int rowCount = buildTable ( table , startCount , endCount ) ; GfJsonArray array = table . getHeaders ( ) ; headers = new String [ array . size ( ) ] ; rows = new Object [ rowCount ] [ array . size ( ) ] ; for ( int i = 0 ; i < array . size ( ) ; i ++ ) { headers [ i ] = ( String ) array . get ( i ) ; List < String > list = table . retrieveAllValues ( headers [ i ] ) ; for ( int j = 0 ; j < list . size ( ) ; j ++ ) { rows [ j ] [ i ] = list . get ( j ) ; } } fields . add ( NUM_ROWS ) ; values . add ( ( selectResult == null ) ? 0 : selectResult . size ( ) ) ; if ( queryTraceString != null ) { fields . add ( QUERY_TRACE ) ; values . add ( queryTraceString ) ; } return createPageResult ( fields , values , step , headers , rows ) ; } catch ( GfJsonException e ) { String [ ] headers = new String [ ] { "Error" } ; Object [ ] [ ] rows = { { e . getMessage ( ) } } ; String fieldsArray [ ] = { QUERY_PAGE_START , QUERY_PAGE_END } ; Object valuesArray [ ] = { startCount , endCount } ; return createPageResult ( fieldsArray , valuesArray , step , headers , rows ) ; } } else return createBannerResult ( fields , values , step ) ; } }
this method returns a " page " as dictated by arguments startcount and endcount . returned result is not standard commandresult and its consumed by display step
