List of utility methods to do List Reverse
List | invertList(List Invert / Reverse the provided List . if (isEmpty(list)) { return list; List<V> invertList = new ArrayList<V>(list.size()); for (int i = list.size() - 1; i >= 0; i--) { invertList.add(list.get(i)); return invertList; ... |
void | reverse(List reverse if (end <= begin) throw new IllegalArgumentException("end <= begin"); if (end - begin == 1) return; List<E> reversed = new ArrayList<E>(end - begin); for (int i = begin; i != end; ++i) { final int j = begin + (end - i - 1); reversed.add(list.get(j)); ... |
List | reverse(List reverse List<T> tmp = new ArrayList<T>(list); list.clear(); for (int index = tmp.size() - 1; index >= 0; index--) { list.add(tmp.get(index)); return list; |