List of utility methods to do List Reverse
List | reverse(Collection Returns a list that contains the elements of the specified list in reversed order. ArrayList<T> reversed = new ArrayList<T>(list); Collections.reverse(reversed); return reversed; |
Iterable | reverse(final List reverse return new Iterable<E>() { @Override public Iterator<E> iterator() { final ListIterator<E> it = list.listIterator(list.size()); return new Iterator<E>() { @Override public boolean hasNext() { return it.hasPrevious(); ... |
ArrayList | reverse(final List Reverse order of elements in a list. ArrayList<T> r = new ArrayList<T>(); for (int i = a.size() - 1; i >= 0; i--) { r.add(a.get(i)); return r; |
List | reverse(final List reverse final List<T> newL = new ArrayList<T>(l); Collections.reverse(newL); return newL; |
List | reverse(final List reverse Collections.reverse(list);
return list;
|
Iterable | reverse(final List reverse return new Iterable<T>() { @Override public Iterator<T> iterator() { final ListIterator<T> listIter = list.listIterator(list.size()); return new Iterator<T>() { @Override public boolean hasNext() { return listIter.hasPrevious(); ... |
List | reverse(final List reverse final ArrayList<T> result = new ArrayList<>(list); Collections.reverse(result); return result; |
void | reverse(final List Reverse a list. final int len = list.size(); if (len <= 0) return; for (int i = 0, j = len - 1; i < j; i++, j--) { T t = list.get(i); list.set(i, list.get(j)); list.set(j, t); |
List | reverse(final List reverse final LinkedList<T> result = new LinkedList<T>(); for (final T s : strings) { result.addFirst(s); return Collections.unmodifiableList(result); |
List | reverse(List aList) Reverses the items in the given list. for (int i = 0, max = aList.size(), iMax = max / 2; i < iMax; i++) { int oppositeIndex = max - i - 1; Object original = aList.set(i, aList.get(oppositeIndex)); aList.set(oppositeIndex, original); return aList; |