Java ArrayList Remove removeDuplicates(ArrayList a)

Here you can find the source of removeDuplicates(ArrayList a)

Description

remove Duplicates

License

Open Source License

Declaration

public static <T> ArrayList<T> removeDuplicates(ArrayList<T> a) 

Method Source Code


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

import java.util.ArrayList;

public class Main {
    public static <T> ArrayList<T> removeDuplicates(ArrayList<T> a) {
        ArrayList<T> result = new ArrayList<T>();

        for (T t : a)
            if (!result.contains(t))
                result.add(t);//  w  w w.  j a  v  a 2s  . co  m

        return result;
    }
}

Related

  1. removeAllFromArrayList(ArrayList collection, Collection toRemove)
  2. removeAllListaProd(ArrayList lista)
  3. removeAlreadyParsedFolders(ArrayList listStrings, String pickup, String limit)
  4. removeByReference(ArrayList list, T object)
  5. removeDuplicates(ArrayList al)
  6. removeDuplicateWithOrder(List arrayList)
  7. removeElementsFromIndexToEnd(ArrayList list, int index)
  8. removeExtraPunctuation(String line, int startChar, ArrayList indices)
  9. removeIndex(ArrayList arr, ArrayList idNames)