Java Collection Copy copyStringCollection(Collection strings)

Here you can find the source of copyStringCollection(Collection strings)

Description

copy String Collection

License

BSD License

Declaration

private static Collection<String> copyStringCollection(Collection<String> strings) 

Method Source Code


//package com.java2s;
/*L/*from   ww  w.  j av a  2  s  .c  o m*/
 * Copyright The General Hospital Corporation d/b/a Massachusetts General Hospital
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/digital-model-repository/LICENSE.txt for details.
 */

import java.util.ArrayList;
import java.util.Collection;

public class Main {
    private static Collection<String> copyStringCollection(Collection<String> strings) {
        if (strings == null) {
            return null;
        }
        Collection<String> result = new ArrayList<String>(strings.size());
        result.addAll(strings);
        return result;
    }
}

Related

  1. copy2Collection(Object[] strs)
  2. copyColl(Collection out, Iterable set)
  3. copyIntoCollectionFrom(Collection collection, Iterable iterable)
  4. copyNSorted(final Collection source, final Collection dest, final Comparator order, final int n)
  5. copyRemainder(final T[] sourceArray, final int startIndex, final Collection collector)
  6. copyWithoutNull(Collection orig)
  7. createSet(Collection toCopy)
  8. maskedCopyOf(final Collection source, final Collection mask)
  9. shallowCopy(Collection collection)