Sorts the list by proximity to the given target color (using RGB distance
metrics).
@see #sortByProximityTo(ReadonlyTColor, DistanceProxy, boolean)
@param target
color
@param isReversed
true, if reverse sorted
@return sorted list
507836
function(target, proxy, isReversed){
		if(arguments.length == 2){
			target = arguments[0];
			proxy = new RGBDistanceProxy();
			isReversed = arguments[1];
		}
		return this.sortByComparator(new ProximityComparator(target,proxy), isReversed);
	}
691638
public static <T> Iterator<T> reverseIterator(final List<T> list) {
		return new Iterator<T>() {

			private int next = list.size() - 1;

			@Override
			@Pure
			public boolean hasNext() {
				return this.next >= 0;
			}

			@Override
			public T next() {
				final int n = this.next;
				--this.next;
				try {
					return list.get(n);
				} catch (IndexOutOfBoundsException exception) {
					throw new NoSuchElementException();
				}
			}

		};
	}
839113
public void sortByDocID() {
        Collections.sort(this, new Comparator<RevisionInternal>() {
            public int compare(RevisionInternal rev1, RevisionInternal rev2) {
                return rev1.getDocID().compareTo(rev2.getDocID());
            }
        });
    }
114348
public static int getCDSLengthReverse(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) {

		int codingLength = 0;

		if (cdsEnd < cdsStart) {
			int tmp = cdsEnd;
			cdsEnd = cdsStart;
			cdsStart = tmp;
		}
		cdsStart = cdsStart + base;

		// map reverse
		for (int i = exonStarts.size() - 1; i >= 0; i--) {

			int end = exonStarts.get(i);
			int start = exonEnds.get(i);

			if (end < start) {
				int tmp = end;
				end = start;
				start = tmp;
			}
			start = start + base;

			if ((start < cdsStart && end < cdsStart) || (start > cdsEnd && end > cdsEnd))
				continue;

			if (start < cdsStart)
				start = cdsStart;

			if (end > cdsEnd)
				end = cdsEnd;

			codingLength += (end - start + 1);
		}
		return codingLength - 3;
	}
453123
static double[] sortAndRevert(final double[] array) {
		final int[] indexes = sort(array);

		// Copy the elements in reversed order.
		final double[] result = new double[array.length];
		for (int i = 0; i < result.length; ++i) {
			result[indexes[result.length - 1 - i]] = array[indexes[i]];
		}

		return result;
	}
642267
EdgeIteratorState copyProperties(EdgeIteratorState from, CommonEdgeIterator to) {
        boolean reverse = from.get(REVERSE_STATE);
        if (to.reverse)
            reverse = !reverse;
        // in case reverse is true we have to swap the nodes to store flags correctly in its "storage direction"
        int nodeA = reverse ? from.getAdjNode() : from.getBaseNode();
        int nodeB = reverse ? from.getBaseNode() : from.getAdjNode();
        long edgePointer = edgeAccess.toPointer(to.getEdge());
        int linkA = reverse ? edgeAccess.getLinkB(edgePointer) : edgeAccess.getLinkA(edgePointer);
        int linkB = reverse ? edgeAccess.getLinkA(edgePointer) : edgeAccess.getLinkB(edgePointer);
        edgeAccess.writeEdge(to.getEdge(), nodeA, nodeB, linkA, linkB);
        edgeAccess.writeFlags(edgePointer, from.getFlags());

        // copy the rest with higher level API
        to.setDistance(from.getDistance()).
                setName(from.getName()).
                setWayGeometry(from.fetchWayGeometry(0));

        if (E_ADDITIONAL >= 0)
            to.setAdditionalField(from.getAdditionalField());
        return to;
    }
546622
public static <T extends Comparable<? super T>> ArrayList<T> sortThis(ArrayList<T> list)
    {
        return ArrayListIterate.sortThis(list, Comparators.naturalOrder());
    }
1342904
@Override
	public ParallelTransformation reversed(boolean reversed)
	{
		if (!reversed)
			return this;

		for (Transformation<?, ?> transformation : listTransformations)
			transformation.reversed(true);

		return this;
	}
890333
public static <T> Comparator<T> inverse(final Comparator<T> baseComp)
  {
    return new Comparator<T>()
    {
      @Override
      public int compare(T t, T t1)
      {
        return baseComp.compare(t1, t);
      }
    };
  }
1117270
public static <C extends Comparable> Ordering<Range<C>> orderingByLowerEndpoint() {
        return new Ordering<Range<C>>() {
            @Override
            public int compare(final Range<C> left, final Range<C> right) {
                return ComparisonChain.start()
                    .compare(left.hasLowerBound(), right.hasLowerBound())
                    .compare(left.lowerEndpoint(), right.lowerEndpoint())
                    .result();
            }
        };
    }
353317
public void apply(Object target) throws InvalidOrderingException {
        /*
         * Note that some subclasses of Ordering override apply(). The Sorter
         * subclass of Ordering overrides apply() to apply the sort (this is
         * done because sorting is more efficient than ordering).
         */
        if (target instanceof Orderable) {
            Orderable orderable = (Orderable) target;
            orderable.order(new Orderer(this));
        }
    }
997554
@SuppressWarnings("WeakerAccess")
    public static void reverse(int[] order, int offset, int length) {
        for (int i = 0; i < length / 2; i++) {
            int t = order[offset + i];
            order[offset + i] = order[offset + length - i - 1];
            order[offset + length - i - 1] = t;
        }
    }
967744
public static <T> ArrayList<T> sortThis(ArrayList<T> list, Comparator<? super T> comparator)
    {
        int size = list.size();
        if (ArrayListIterate.canAccessInternalArray(list))
        {
            Arrays.sort(ArrayListIterate.getInternalArray(list), 0, size, comparator);
        }
        else
        {
            Collections.sort(list, comparator);
        }
        return list;
    }
545060
public static StateListDrawable getDrawerItemBackground(int selected_color) {
        ColorDrawable clrActive = new ColorDrawable(selected_color);
        StateListDrawable states = new StateListDrawable();
        states.addState(new int[]{android.R.attr.state_selected}, clrActive);
        return states;
    }
958780
public boolean isInverse() {
		Boolean value = (Boolean) getStateHelper().eval(PropertyKeys.inverse, false);
		return (boolean) value;
	}
1362283
public IntStreamEx reverseSorted() {
        IntUnaryOperator inv = x -> ~x;
        return new IntStreamEx(stream().map(inv).sorted().map(inv), context);
    }
907605
public RawKeyValueIterator sort() {
    MergeSort m = new MergeSort(this);
    int count = super.count;
    if (count == 0) return null;
    int [] pointers = super.pointers;
    int [] pointersCopy = new int[count];
    System.arraycopy(pointers, 0, pointersCopy, 0, count);
    m.mergeSort(pointers, pointersCopy, 0, count);
    return new MRSortResultIterator(super.keyValBuffer, pointersCopy, 
                                    super.startOffsets, super.keyLengths, super.valueLengths);
  }