Java Collection Convert to2DStringArray(Collection coll)

Here you can find the source of to2DStringArray(Collection coll)

Description

to D String Array

License

Open Source License

Parameter

Parameter Description
coll Collection

Return

String[][]

Declaration

public static String[][] to2DStringArray(Collection coll) 

Method Source Code

//package com.java2s;
/*//  w  w  w.ja  va  2  s. c om
 * $Id$
 *
 * Copyright 2006-2008 Alex Lin. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.Collection;

public class Main {
    /**
     *
     * @param coll Collection
     * @return String[][]
     */
    public static String[][] to2DStringArray(Collection coll) {
        return (String[][]) coll.toArray(new String[coll.size()][]);
    }
}

Related

  1. convertToCollection(Object source)
  2. convertToHqlParameters(Collection numbers)
  3. convertToIntArray(Collection col)
  4. convertToPrimitive(Collection info)
  5. to2DIntArray(Collection coll)
  6. toAlphaCollection(Collection collection)
  7. toArray(Collection items, Object array[], boolean convert_to_primitive)
  8. toCollectionString(Collection c, char sep)
  9. toCollectionString(Collection collection_p)