Java Collection Convert convertArrayInCollection(String[] array)

Here you can find the source of convertArrayInCollection(String[] array)

Description

convert Array In Collection

License

Mozilla Public License

Declaration

static public Collection convertArrayInCollection(String[] array) 

Method Source Code

//package com.java2s;
/* SpagoBI, the Open Source Business Intelligence suite
    //  w  w  w  .  j av a 2 s.  co  m
 * Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0, without the "Incompatible With Secondary Licenses" notice. 
 * If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */

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

public class Main {
    static public Collection convertArrayInCollection(String[] array) {
        Collection coll = new ArrayList();

        for (int i = 0; i < array.length; i++) {
            String role = array[i];
            coll.add(role);
        }
        return coll;
    }
}

Related

  1. convert(Collection list)
  2. convert(Collection c)
  3. convert2IntegerCollection(String[] strs)
  4. convertCharCollectionToArray(Collection chars)
  5. convertCollectionInArray(Collection coll)
  6. convertCollectionStringToCSV(Collection coll, boolean valueInSingleQuotes)
  7. convertCollectionType(Iterable from, C newCollection, Class listClass)