MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / sort

Method sort

Ports/CLDC11/src/java/util/Collections.java:1925–1935  ·  view source on GitHub ↗
(List<T> list)

Source from the content-addressed store, hash-verified

1923 /// when an element in the List does not implement Comparable or
1924 /// elements cannot be compared to each other.
1925 @SuppressWarnings("unchecked")
1926 public static <T extends java.lang.Comparable<? super T>> void sort(List<T> list) {
1927 Object[] array = list.toArray();
1928 Arrays.sort(array);
1929 int i = 0;
1930 ListIterator<T> it = list.listIterator();
1931 while (it.hasNext()) {
1932 it.next();
1933 it.set((T) array[i++]);
1934 }
1935 }
1936
1937 /// Sorts the specified list using the specified comparator. The algorithm is
1938 /// stable which means equal elements don't get reordered.

Callers 2

dataSetChangedMethod · 0.95
sortChildDrawingOrderMethod · 0.95

Calls 7

sortMethod · 0.95
toArrayMethod · 0.65
listIteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
setMethod · 0.65
sizeMethod · 0.65

Tested by

no test coverage detected