Examples of Sorting


Examples of com.tll.dao.Sorting

    if(ofst < 0 || (!force && ofst > listHandler.size() - 1)) {
      throw new IndexOutOfBoundsException("Listing offset " + ofst + " is out of bounds");
    }

    // do we need to actually re-query?
    final Sorting sorting = getSorting();
    if(!force && elements != null && this.offset == ofst && sorting != null && sorting.equals(srtg)) {
      return;
    }

    // query
    final int psize = pageSize == -1 ? listHandler.size() : pageSize;
View Full Code Here

Examples of com.tll.dao.Sorting

      }
      else {
        final ListingCache lcache = context.getListingCache();
        assert lcache != null : "Null ListingCache";
        Integer offset = request.getOffset();
        Sorting sorting = request.getSorting();

        // get listing state (if cached)
        final ListingState state = lcache.getState(sessionId, listingId);
        if(state != null) {
          log.debug("Found cached state for listing '{}': {}", listingId, state.toString());
          if(offset == null) {
            offset = state.getOffset();
            assert offset != null;
            log.debug("Setting offset ({}) from cache for listing: {}", offset, listingId);
          }
          if(sorting == null) {
            sorting = state.getSorting();
            assert sorting != null;
            log.debug("Setting sorting ({}) from cache for listing: {}", sorting.toString(), listingId);
          }
        }

        handler = lcache.getHandler(sessionId, listingId);
        listingStatus = (handler == null ? ListingStatus.NOT_CACHED : ListingStatus.CACHED);
View Full Code Here

Examples of com.tll.dao.Sorting

  public IListHandler<? extends IMarshalable> getRowListHandler(
      RemoteListingDefinition<? extends IMarshalable> listingDef) {
    try {
      // just create a list handler full of test address entities
      Collection<Address> clc = egraph.getEntitiesByType(Address.class);
      IListHandler<Address> lh = ListHandlerFactory.create(clc, new Sorting("address1"));
      return new AddressDtoListHandler(lh);
    }
    catch(Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of de.mh4j.examples.Sorting

    public void testCreateRandomNeighbor() {
        LocalSearchSorter sorter = new LocalSearchSorter(10);
        // invoke step to initialize the solver
        sorter.step();

        Sorting initialSorting = sorter.getCurrentSolution();
        Sorting neighbor = sorter.createRandomNeighbor();

        assert initialSorting.equals(neighbor) == false;
    }
View Full Code Here

Examples of de.mh4j.examples.Sorting

     * Hopefully one of the swapped numbers will be nearer to its optimal
     * position in the sorting and decrease the cost of the whole new sorting.
     */
    @Override
    protected Sorting createRandomNeighbor() {
        Sorting neighbor = new Sorting(currentSolution);

        int randomIndex1 = randomizer.nextInt(currentSolution.getAmountOfNumbers());
        int randomIndex2 = randomizer.nextInt(currentSolution.getAmountOfNumbers() - 1);

        if (randomIndex1 <= randomIndex2) {
            randomIndex2++;
        }

        neighbor.swapIndices(randomIndex1, randomIndex2);
        return neighbor;
    }
View Full Code Here

Examples of de.mh4j.examples.Sorting

     * Hopefully one of the swapped numbers will be nearer to its optimal
     * position in the sorting and decrease the cost of the whole new sorting.
     */
    @Override
    protected Sorting createRandomNeighbor() {
        Sorting neighbor = new Sorting(currentSolution);

        int randomIndex1 = randomizer.nextInt(currentSolution.getAmountOfNumbers());
        int randomIndex2 = randomizer.nextInt(currentSolution.getAmountOfNumbers());

        neighbor.swapIndices(randomIndex1, randomIndex2);
        return neighbor;
    }
View Full Code Here

Examples of org.dyno.visual.swing.base.ExtensionRegistry.Sorting

  public void setFieldAccess(int fieldAccess) {
    this.fieldAccess = fieldAccess;
  }

  public ArrayList<IWidgetPropertyDescriptor> getPropertyDescriptors() {
    Sorting sorting = ExtensionRegistry.getCurrentSorting();
    HashMap<String, String> references = new HashMap<String, String>();
    Class beanClass = getWidgetClass();
    ArrayList<IWidgetPropertyDescriptor> propdesc = new ArrayList<IWidgetPropertyDescriptor>();
    for (Category category : sorting.getCategories().values()) {
      Provider provider = getProvider(category.getProviders(), beanClass);
      if (provider != null) {
        for (String refid : provider.getRefIds()) {
          IConfigurationElement prop = this.propertyConfigs.get(refid);
          if (prop != null) {
            references.put(refid, refid);
            IWidgetPropertyDescriptor property = createProperty(prop, beanClass);
            property.setCategory(category.getName());
            property.setFilterFlags(category.getFilters());
            propdesc.add(property);
          }
        }
      }
    }
    String defaultId = sorting.getDefaultCategory();
    Category category = sorting.getCategories().get(defaultId);
    for (String refid : propertyConfigs.keySet()) {
      if (references.get(refid) == null) {
        references.put(refid, refid);
        IConfigurationElement prop = propertyConfigs.get(refid);
        if (prop != null) {
View Full Code Here

Examples of org.graylog2.indexer.searches.Sorting

        checkSearchPermission(filter, RestPermissions.SEARCHES_KEYWORD);

        checkQueryAndKeyword(query, keyword);

        final List<String> fieldList = parseOptionalFields(fields);
        Sorting sorting = buildSorting(sort);

        TimeRange timeRange = buildKeywordTimeRange(keyword);
        final SearchesConfig searchesConfig = SearchesConfigBuilder.newConfig()
                .setQuery(query)
                .setFilter(filter)
View Full Code Here

Examples of org.graylog2.indexer.searches.Sorting

        checkSearchPermission(filter, RestPermissions.SEARCHES_RELATIVE);

        checkQuery(query);

        final List<String> fieldList = parseOptionalFields(fields);
        Sorting sorting = buildSorting(sort);

        TimeRange timeRange = buildRelativeTimeRange(range);
        final SearchesConfig searchesConfig = SearchesConfigBuilder.newConfig()
                .setQuery(query)
                .setFilter(filter)
View Full Code Here

Examples of org.graylog2.indexer.searches.Sorting

            @ApiParam(name = "sort", value = "Sorting (field:asc / field:desc)", required = false) @QueryParam("sort") String sort) {
        checkSearchPermission(filter, RestPermissions.SEARCHES_ABSOLUTE);

        checkQuery(query);

        Sorting sorting = buildSorting(sort);

        final List<String> fieldList = parseOptionalFields(fields);
        TimeRange timeRange = buildAbsoluteTimeRange(from, to);
        final SearchesConfig searchesConfig = SearchesConfigBuilder.newConfig()
                .setQuery(query)
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.