Java Collection Convert convert2IntegerCollection(String[] strs)

Here you can find the source of convert2IntegerCollection(String[] strs)

Description

convert Integer Collection

License

MIT License

Declaration

public static Collection convert2IntegerCollection(String[] strs) 

Method Source Code

//package com.java2s;
/**/* w  w w . j av  a 2  s  .  c  o m*/
 * Copyright (c) 2004-2011 Wang Jinbao(Julian Wong), http://www.ralasafe.com
 * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
 */

import java.util.ArrayList;

import java.util.Collection;

public class Main {
    public static Collection convert2IntegerCollection(String[] strs) {
        Collection result = null;
        if (strs == null) {
            result = new ArrayList(0);
        } else {
            result = new ArrayList(strs.length);
            for (int i = 0; i < strs.length; i++) {
                // String s=strs[i];
                result.add(new Integer(strs[i]));
            }
        }

        return result;
    }
}

Related

  1. convert(Collection list)
  2. convert(Collection c)
  3. convertArrayInCollection(String[] array)
  4. convertCharCollectionToArray(Collection chars)
  5. convertCollectionInArray(Collection coll)
  6. convertCollectionStringToCSV(Collection coll, boolean valueInSingleQuotes)