Java Utililty Methods List Reverse

List of utility methods to do List Reverse

Description

The list of methods to do List Reverse are organized into topic(s).

Method

voidreverse(List list)
reverse
Object a[] = list.toArray();
list.clear();
for (int i = a.length - 1; i >= 0; i--) {
    Object o = a[i];
    list.add(o);
voidreverse(List list)
Reverse a list.
Collections.reverse(list);
Listreverse(List as)
reverse
return reverse(as, Collections.EMPTY_LIST);
Listreverse(List list)
Returns a new list with the items in the given list in reverse order.
if (list == null)
    return null;
List<E> reverseList = create();
for (int i = list.size() - 1; i >= 0; i--) {
    reverseList.add(list.get(i));
return reverseList;
Listreverse(List source)
reverse
ArrayList<F> backwardsSource = new ArrayList<F>(source);
Collections.reverse(backwardsSource);
return backwardsSource;
voidreverse(List list)
reverse the given list
List<Object> listCopy = new ArrayList<Object>(list.size());
for (Object object : list) {
    listCopy.add(object);
list.clear();
int count = listCopy.size();
for (int i = count - 1; i >= 0; i--) {
    list.add(listCopy.get(i));
...
Listreverse(List list)
Create a new instance of list which has elements in reverse order
List<String> reversedList = new ArrayList<String>(list);
Collections.reverse(reversedList);
return reversedList;
Listreverse(List a)
reverse
List<T> r = new ArrayList<T>();
for (int i = a.size() - 1; i >= 0; i--) {
    r.add(a.get(i));
return r;
Listreverse(List l)
reverse
List<T> nl = new LinkedList<T>(l);
Collections.reverse(nl);
return nl;
Listreverse(List list)
reverse
List<T> nlist = new ArrayList<T>(list);
Collections.reverse(nlist);
return nlist;