Java Array Reverse reverseArrayList(ArrayList listIn)

Here you can find the source of reverseArrayList(ArrayList listIn)

Description

This will simply reverse an ArrayList

License

Open Source License

Parameter

Parameter Description
listIn The ArrayList to be reversed

Declaration

public static ArrayList reverseArrayList(ArrayList listIn) 

Method Source Code

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

import java.util.ArrayList;
import java.util.Collections;

public class Main {
    /**/*from   w  w w  . j  a va2  s .c o m*/
     * This will simply reverse an ArrayList
     * 
     * @param listIn
     *            The ArrayList to be reversed
     * @return
     */
    public static ArrayList reverseArrayList(ArrayList listIn) {
        ArrayList reversed = (ArrayList) listIn.clone();
        Collections.reverse(reversed);
        return reversed;
    }
}

Related

  1. reverse(T[] array)
  2. reverse(T[] originalArray)
  3. reverseArray(final T[] arr)
  4. reverseArray(Object[] arr)
  5. reverseArray(T[] arr)
  6. reverseList (ArrayList l)
  7. reverseRange(final T[] arr, final int from, final int to)
  8. reverseSortedSet(int[] ints)
  9. sortReversed(final int[] a)

  10. HOME | Copyright © www.java2s.com 2016