Java List Reverse reverseList(List list)

Here you can find the source of reverseList(List list)

Description

reverse List

License

Open Source License

Declaration

public static <T> List<T> reverseList(List<T> list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static <T> List<T> reverseList(List<T> list) {
        List<T> theReturn = new ArrayList<T>();
        int size = list.size();
        for (int i = size - 1; i >= 0; i--) {
            T item = list.get(i);//  w w w.  j a  v a  2 s.  c  om
            if (item != null) {
                theReturn.add(item);
            }
        }
        return theReturn;
    }
}

Related

  1. reverseIterator(final List list)
  2. reverseIterator(List list)
  3. reverseIterator(ListIterator iterator)
  4. reverseList(final List list)
  5. reverseList(List list)
  6. reverseList(List list, boolean shallowCopy)
  7. reverseList2(List list)
  8. reverseListShallowCopy(List list)
  9. reverseOrder(List list)