Orders aggregation chains.

@param chains
aggregation chains to be ordered.
@return ordered list of aggregation chains
503235
private List<AggregationHashChain> sortAggregationHashChains(List<AggregationHashChain> chains) throws InvalidSignatureException {
        Collections.sort(chains, new Comparator<AggregationHashChain>() {
            public int compare(AggregationHashChain chain1, AggregationHashChain chain2) {
                return chain2.getChainIndex().size() - chain1.getChainIndex().size();
            }
        });
        return chains;
    }
1216017
public <T> List<T> reorder( List<T> sequence)
    {
    int elementCount = sequence.size();
    if( elementCount > 1)
      {
      List<T> elements = new ArrayList<T>( sequence);
      sequence.clear();

      for( ; elementCount > 0; elementCount--)
        {
        sequence.add( elements.remove( generator_.nextInt( elementCount)));
        }
      }

    return sequence;
    }
1293919
public OrderingList<S> reduce() {
        if (size() == 0) {
            return this;
        }

        Set<ChainedProperty<S>> seen = new HashSet<ChainedProperty<S>>();
        OrderingList<S> newList = emptyList();

        for (OrderedProperty<S> property : this) {
            ChainedProperty<S> chained = property.getChainedProperty();
            if (!seen.contains(chained)) {
                newList = newList.concat(property);
                seen.add(chained);
            }
        }

        return newList;
    }
1311014
public List<AggregationDistinctSelectItem> getAggregationDistinctSelectItems() {
        List<AggregationDistinctSelectItem> result = new LinkedList<>();
        for (SelectItem each : items) {
            if (each instanceof AggregationDistinctSelectItem) {
                result.add((AggregationDistinctSelectItem) each);
            }
        }
        return result;
    }
442130
public OkCoinFuturesOrderResult getFuturesOrders(
      String orderIds, String symbol, FuturesContract contract) throws IOException {

    OkCoinFuturesOrderResult futuresOrder =
        okCoin.getFuturesOrders(apikey, orderIds, symbol, contract.getName(), signatureCreator());
    return returnOrThrow(futuresOrder);
  }
405223
public static <S extends Storable> OrderingList<S> get(List<OrderedProperty<S>> orderings) {
        OrderingList<S> list = emptyList();
        if (orderings != null && orderings.size() > 0) {
            for (OrderedProperty<S> property : orderings) {
                list = list.concat(property);
            }
        }
        return list;
    }
973012
public void setAggregators(java.util.Collection<InventoryAggregator> aggregators) {
        if (aggregators == null) {
            this.aggregators = null;
            return;
        }

        this.aggregators = new com.amazonaws.internal.SdkInternalList<InventoryAggregator>(aggregators);
    }
411004
@PublicEvolving
	public PartitionOperator<T> withOrders(Order... orders) {
		Preconditions.checkState(pMethod == PartitionMethod.RANGE, "Orders cannot be applied for %s partition " +
				"method", pMethod);
		Preconditions.checkArgument(pKeys.getOriginalKeyFieldTypes().length == orders.length, "The number of key " +
				"fields and orders should be the same.");
		this.orders = orders;

		return this;
	}
756490
public Collection<String> getOrdererNames() {
        if (orderers == null) {
            return Collections.EMPTY_SET;
        } else {
            return new HashSet<>(orderers.keySet());
        }
    }
701590
public ListOrdersResult withOrders(Order... values) {
        List<Order> list = getOrders();
        for (Order value : values) {
            list.add(value);
        }
        return this;
    }
953071
public java.util.List<AggregateComplianceCount> getAggregateComplianceCounts() {
        if (aggregateComplianceCounts == null) {
            aggregateComplianceCounts = new com.amazonaws.internal.SdkInternalList<AggregateComplianceCount>();
        }
        return aggregateComplianceCounts;
    }
889900
public static <S extends Storable> OrderingList<S> get(OrderedProperty<S>... orderings) {
        OrderingList<S> list = emptyList();
        if (orderings != null && orderings.length > 0) {
            for (OrderedProperty<S> property : orderings) {
                list = list.concat(property);
            }
        }
        return list;
    }
1002777
public List<T> getSortedKeys() {
    List<T> l = Lists.newArrayList(counts.keySet());
    Collections.sort(l, Ordering.natural().reverse().onResultOf(Functions.forMap(counts.getBaseMap())));
    return l;
  }
1046076
public List<Order> create(OrderBy order) {
        List<Order> list = new ArrayList<>();

        for (SortSpecification sort : order.getSort()) {
            if (sort.getSortOrder() == SortOrder.DESC) {
                list.add(cb.desc(root.get(sort.getKey())));
            } else if (sort.getSortOrder() == SortOrder.ASC) {
                list.add(cb.asc(root.get(sort.getKey())));
            }
        }

        return list;
    }
1262193
public void setEventAggregates(java.util.Collection<EventAggregate> eventAggregates) {
        if (eventAggregates == null) {
            this.eventAggregates = null;
            return;
        }

        this.eventAggregates = new java.util.ArrayList<EventAggregate>(eventAggregates);
    }
200034
public static List<Group> getAminoAcids(Chain chain) {

		List<Group> gs = new ArrayList<>();

		for ( Group g : chain.getAtomGroups()){

			if ( g.isAminoAcid())
				gs.add(g);

		}

		return gs;

	}
167046
public List<Description> order(Collection<Description> descriptions)
            throws InvalidOrderingException {
        List<Description> inOrder = ordering.orderItems(
                Collections.unmodifiableCollection(descriptions));
        if (!ordering.validateOrderingIsCorrect()) {
            return inOrder;
        }

        Set<Description> uniqueDescriptions = new HashSet<Description>(descriptions);
        if (!uniqueDescriptions.containsAll(inOrder)) {
            throw new InvalidOrderingException("Ordering added items");
        }
        Set<Description> resultAsSet = new HashSet<Description>(inOrder);
        if (resultAsSet.size() != inOrder.size()) {
            throw new InvalidOrderingException("Ordering duplicated items");
        } else if (!resultAsSet.containsAll(uniqueDescriptions)) {
            throw new InvalidOrderingException("Ordering removed items");
        }

        return inOrder;
    }