Examples of Sorter


Examples of com.adaptrex.core.ext.Sorter

      List<Sorter> sorters = new ArrayList<Sorter>();
      @SuppressWarnings("unchecked")
      List<Map<String, String>> sort = (List<Map<String, String>>)
          StringUtilities.fromJson(params.get("sort").get(0), List.class);
      for (Map<String,String> sortItem : sort) {
        sorters.add(new Sorter(sortItem.get("property"), sortItem.get("direction"), null));
      }
      storeData.setSorters(sorters);
    }
   
    if (params.containsKey("group")) {
      List<Sorter> groupers = new ArrayList<Sorter>();
      @SuppressWarnings("unchecked")
      List<Map<String, String>> group = (List<Map<String, String>>)
          StringUtilities.fromJson(params.get("group").get(0), List.class);
      for (Map<String,String> groupItem : group) {
        groupers.add(new Sorter(groupItem.get("property"), groupItem.get("direction"), null));
      }
      storeData.setGroupers(groupers);
    }
   
    if (params.containsKey("filter")) {
View Full Code Here

Examples of com.adaptrex.core.ext.Sorter

    this.purgePageCount = purgePageCount;
    return this;
 
 
  public StoreComponent addGrouper(String property, String direction, String root) {
    groupers.add(new Sorter(property, direction, root));
    return this;
  }
View Full Code Here

Examples of com.adaptrex.core.ext.Sorter

    groupers.add(new Sorter(property, direction, root));
    return this;
  }
 
  public StoreComponent addSorter(String property, String direction, String root) {
    sorters.add(new Sorter(property, direction, root));
    return this;
  }   
View Full Code Here

Examples of com.dianping.cat.report.page.app.graph.Sorter

        AppDataGroupByField field) {
    try {
      Pair<PieChart, List<PieChartDetailInfo>> pair = m_appGraphCreator.buildPieChart(payload.getQueryEntity1(),
            field);
      List<PieChartDetailInfo> infos = pair.getValue();
      Collections.sort(infos, new Sorter().buildPieChartInfoComparator());

      return pair;
    } catch (Exception e) {
      Cat.logError(e);
    }
View Full Code Here

Examples of com.ebay.erl.mobius.core.sort.Sorter

      // there is no sorter, should be reducer/join job
      Column[] keys = (Column[])SerializableUtil.deserializeFromBase64(job.get(ConfigureConstants.ALL_GROUP_KEY_COLUMNS), job);
      sorters = new Sorter[keys.length];
      for( int i=0;i<keys.length;i++ )
      {
        sorters[i] = new Sorter(keys[i].getInputColumnName(), Ordering.ASC);
      }
    }
   
    long proportion = 10L;
    while( (int)(this.freq*proportion)==0 ){
View Full Code Here

Examples of com.fasterxml.sort.Sorter

    public void shouldGetStreamFromElasticSearch() {

        SortConfig sortConfig = new SortConfig().withMaxMemoryUsage(256*1024*1024);
        DataReaderFactory<IdAndVersion> dataReaderFactory = new IdAndVersionDataReaderFactory(idAndVersionFactory);
        DataWriterFactory<IdAndVersion> dataWriterFactory = new IdAndVersionDataWriterFactory();
        Sorter sorter = new Sorter(sortConfig, dataReaderFactory, dataWriterFactory, new NaturalComparator<IdAndVersion>());
        ElasticSearchDownloader elasticSearchDownloader = new ElasticSearchDownloader(client, INDEX_NAME, "_type:idandversion", idAndVersionFactory);
        ElasticSearchIdAndVersionStream elasticSearchIdAndVersionStream =
                new ElasticSearchIdAndVersionStream(elasticSearchDownloader, new ElasticSearchSorter(sorter), new IteratorFactory(idAndVersionFactory), SystemUtils.getJavaIoTmpDir().getAbsolutePath());

        elasticSearchIdAndVersionStream.open();
View Full Code Here

Examples of com.foundationdb.qp.storeadapter.Sorter

        API.Ordering ordering = API.ordering();
        for(int i = 0; i < fieldOrdering.length; ++i) {
            ordering.append(field(inputOperator.rowType(), i), fieldOrdering[i]);
        }

        Sorter sorter = createSorter(context, bindings, inputCursor, inputOperator.rowType(), ordering, sortOption, TEST_TAP);
        RowCursor sortedCursor = sorter.sort();

        Row[] expectedRows = createBuilder(expected).rows().toArray(new Row[expected.size()]);
        compareRows(expectedRows, sortedCursor);
    }
View Full Code Here

Examples of com.jdkcn.myblog.util.Sorter

    int start = 0;
    if (p != null && p > 1) {
      start = (p - 1) * size;
    }
    Range range = new Range(start, size);
    ps = entryService.search(condition, range, new Sorter().desc("createDate"));
    entries = ps.getItems();
  }
View Full Code Here

Examples of com.jdkcn.myblog.util.Sorter

    String content = "Content";
    for (int i = 0; i < 30; i++) {
      createEntry(title + i, content + i);
    }
    EntryCondition condition = new EntryCondition();
    PaginationSupport<Entry> ps = entryService.search(condition, new Range(0, 10), new Sorter().asc("publishDate"));
    assertEquals(30, ps.getTotalCount());
   
    title = "Android";
    for (int j = 0; j < 5; j ++) {
      createEntry(title + j, content + j);
    }
   
    condition.setKeyword("Android");
    ps = entryService.search(condition, new Range(0, 5), new Sorter().asc("title"));
    assertEquals(5, ps.getTotalCount());
  }
View Full Code Here

Examples of com.jdkcn.myblog.util.Sorter

public class SorterTest {

 
  @Test
  public void testSorter() throws Exception {
    Sorter sorter = new Sorter().desc("name").asc("property").desc("createDate");
    String hql = "from Entry entry";
    String orderedHql = "from Entry entry order by name desc,property asc,createDate desc";
    assertEquals(sorter.decorate(hql), orderedHql);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.