Here you can find the source of toStrings(Collection vals)
Parameter | Description |
---|---|
vals | a parameter |
public static String[] toStrings(Collection vals)
//package com.java2s; //License from project: Apache License import java.util.Collection; import java.util.Iterator; public class Main { /**// w ww.j a v a 2 s .com * @param vals * @return */ public static String[] toStrings(Collection vals) { int size = vals.size(), cnt = 0; String[] strings = new String[size]; for (Iterator itr = vals.iterator(); itr.hasNext();) { String s = (String) itr.next(); if (s != null) { strings[cnt] = s; cnt++; } } return strings; } }