Java List Copy copySafelyToObjectList(java.util.List list)

Here you can find the source of copySafelyToObjectList(java.util.List list)

Description

copy Safely To Object List

License

Open Source License

Declaration

public static java.util.List<Object> copySafelyToObjectList(java.util.List<?> list) 

Method Source Code

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

public class Main {
    public static java.util.List<Object> copySafelyToObjectList(java.util.List<?> list) {
        java.util.Iterator<?> it = list.iterator();
        java.util.List<Object> castedCopy = new java.util.ArrayList<Object>();
        while (it.hasNext()) {
            castedCopy.add(it.next());/*from  w w  w  . j av  a2 s.  co  m*/
        }
        return castedCopy;
    }
}

Related

  1. copyOf(List list)
  2. copyOf(List values)
  3. copyOfRange(List list, int from, int to)
  4. copyProbabilities(List targetProbs, List destinationProbs)
  5. copyQueryFilters(List queryFilters)
  6. copyStringList(List l1)
  7. copyStringList(List list)
  8. copyToArray(List list, float[] array)
  9. copyToArrayListWithExtraCapacity(T[] elements, int extraCapacity)