code: @Override
      public int compare(final Row row0, final Row row1) {
          int result = 0;
  
          for (int i = 0; i < orderbys.size(); i++) {
              final OrderColumn oc = orderbys.get(i);
              // null indicates "detail" record which is what the parser assigns
              // to <column> 's setup outside of <record> elements
              final String mdkey0 = row0.getMdkey() == null ? FPConstants.DETAIL_ID : row0.getMdkey();
              final String mdkey1 = row1.getMdkey() == null ? FPConstants.DETAIL_ID : row1.getMdkey();
  
              // shift all non detail records to the bottom of the DataSet
              if (!mdkey0.equals(FPConstants.DETAIL_ID) && !mdkey1.equals(FPConstants.DETAIL_ID)) {
                  // keep headers / trailers in the same order at the bottom of
                  // the DataSet
                  return 0;
              } else if (!mdkey0.equals(FPConstants.DETAIL_ID) || !mdkey1.equals(FPConstants.DETAIL_ID)) {
                  return !mdkey0.equals(FPConstants.DETAIL_ID) ? 1 : 0;
              }
  
              result = compareCol(row0, row1, oc);
  
              // if it is = 0 then the primary sort is done, and it can start the
              // secondary sorts
              if (result != 0) {
                  break;
              }
          }
  
          return result;
      }
docs: overridden from the Comparator class.
  
  Performs the sort
  
  @return int