Sets the sort criteria to apply to the query.

@param sort the sort criteria, which may be null.
@return this
323678
public CoreRemoteFindIterableImpl<DocumentT, ResultT> sort(@Nullable final Bson sort) {
    findOptions.sort(sort);
    return this;
  }
1050580
public static Sort sort(Sort... sort) {
        if (sort.length == 1) {
            return sort[0];
        } else {
            Sort s = new Sort(true);
            for (Sort x : sort) {
                ((ArrayNode) s.node).add(x.toJson());
            }
            return s;
        }
    }
832411
public function sort(Sorting $sorting)
	{
		if (is_callable($sorting->getSortCallback())) {
			call_user_func(
				$sorting->getSortCallback(),
				$this->data_source,
				$sorting->getSort()
			);

			return $this;
		}

		$sort = $sorting->getSort();

		if (!empty($sort)) {
			$this->data_source->getSqlBuilder()->setOrder([], []);

			foreach ($sort as $column => $order) {
				$this->data_source->order("$column $order");
			}
		} else {
			/**
			 * Has the statement already a order by clause?
			 */
			if (!$this->data_source->getSqlBuilder()->getOrder()) {
				$this->data_source->order($this->primary_key);
			}
		}

		return $this;
	}
765110
@Override
	public AppEngineGetList<E> sort(Order<?, ?>... orders) {
		if (orders == null) {
			throw new IllegalArgumentException("'orders' must not be [" + orders + "]");
		}
		
		this.orders = Arrays.asList(orders);
		return this;
	}
569929
public void setSortCriteria(java.util.Collection<SortCriterion> sortCriteria) {
        if (sortCriteria == null) {
            this.sortCriteria = null;
            return;
        }

        this.sortCriteria = new java.util.ArrayList<SortCriterion>(sortCriteria);
    }
822606
@Override
    public void setOrder(Order order) {
        this.order = order;
        if (order != null) {
            switch (order) {
                case SINGLE:
                    this.electronCount = 2;
                    break;
                case DOUBLE:
                    this.electronCount = 4;
                    break;
                case TRIPLE:
                    this.electronCount = 6;
                    break;
                case QUADRUPLE:
                    this.electronCount = 8;
                    break;
                case QUINTUPLE:
                    this.electronCount = 10;
                    break;
                case SEXTUPLE:
                    this.electronCount = 12;
                    break;
                default:
                    this.electronCount = 0;
                    break;
            }
        }
    }
231028
public function sort(Sorting $sorting)
	{
		if (is_callable($sorting->getSortCallback())) {
			call_user_func(
				$sorting->getSortCallback(),
				$this->criteria,
				$sorting->getSort()
			);

			return $this;
		}

		if ($sort = $sorting->getSort()) {
			$this->criteria->orderBy($sort);
			return $this;
		}

		$this->criteria->orderBy([$this->primary_key => 'ASC']);

		return $this;
	}
791027
public static function bindSort(\Criteria $criteria, $sort) {
        $direction = $sort['direction'];
        switch($direction) {
            case self::SORT_DIRECTION_DESC:
                $criteria->addDescendingOrderByColumn($sort['column']);
                break;
            case self::SORT_DIRECTION_ASC:
                $criteria->addAscendingOrderByColumn($sort['column']);
                break;
            default:
                throw new RuntimeException('Unsupport Ext direct sort direction:'.$direction);
        }
    }
415785
public function setSort($field,$sort = false)
    {
        $this->sort_field = $field;
        $this->sort_state = $sort;
        return $this;
    }
89542
public static <T extends Comparable<? super T>> void sort(List<T> list) {
		if (useQuickSort) QuickSort.sort(list);
		else              Collections.sort(list);
	}
1003719
public void setSorting(List<SortProperty> newSorting) {
		Validate.notNull(newSorting, "Sorting required");

		if (!sorting.equals(newSorting)) {
			sorting.clear();
			sorting.addAll(newSorting);
			selectionIndex = -1;
			clearCache();
		}
	}
264783
public static <K, V> SortedMap<K, V> sort(SortedMap<K, V> self) {
        return self;
    }
70358
public function addOrderBy($column, $sort = null)
        {
            if (is_array($column)) {
                foreach ($column as $single_column) {
                    $this->addOrderBy($single_column[0], $single_column[1]);
                }
            } else {
                $this->sort_orders[] = new QueryColumnSort($column, $sort);
            }

            return $this;
        }
195967
public static <T> OrderBy<T> convertToEbeanOrderBy(Sort sort) {
        if (sort == null) {
            return null;
        }
        List<String> list = new ArrayList<>();

        Iterator<Sort.Order> orderIterator = sort.iterator();
        while (orderIterator.hasNext()) {
            Sort.Order so = orderIterator.next();
            list.add(so.getProperty() + " " + so.getDirection());
        }
        return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list));
    }
83024
public SortingParams nosort() {
    params.add(BY.raw);
    params.add(NOSORT.raw);
    return this;
  }
802794
public static ComparatorItem fromSortOrder(Sort.Order sortOrder) {
    if (sortOrder == null || sortOrder.getProperty() == null
        || sortOrder.getProperty().trim().length() == 0) {
      return null;
    }
    boolean nullIsFirst = Sort.NullHandling.NULLS_FIRST.equals(sortOrder.getNullHandling());
    return new ComparatorItem(sortOrder.getProperty(), sortOrder.isAscending(),
        sortOrder.isIgnoreCase(),
        nullIsFirst);
  }
37283
public void sort() {
        if (!sorted) {
            sort(heap, Math.min(k,n));
            sorted = true;
        }
    }