Exemplo n.º 1
0
 @Override
 public int compareTo(ResultItem o) {
   if (item instanceof Comparable && o.getItem() instanceof Comparable) {
     return ((Comparable) item).compareTo(((Comparable) o.getItem()));
   } else {
     throw new GridQueryException("Item can not be sort");
   }
 }
Exemplo n.º 2
0
  @Override
  public void addResult(String gridId, T result) {
    List<IGridResults<ResultItem<Object>>> allList =
        (List<IGridResults<ResultItem<Object>>>) result;

    for (IGridResults<ResultItem<Object>> gridResults : allList) {
      if (gridResults == null) {
        continue;
      }
      List list = gridResults.getAggregatedSortedResults();
      if (list == null) {
        return;
      }
      List<Object> resultList = new ArrayList<Object>(list.size());

      if (list != null && list.size() > 0) {
        for (ResultItem resultItem : (List<ResultItem>) list) {
          resultList.add(((ValueInfo) resultItem.getItem()).getValue());
        }
      }
      results.setTotalSize(gridResults.getTotalServerResults());
      results.setValueResultList(resultList);
    }
  }