Here you can find the source of convertHashSetIntoArray(HashSet
Parameter | Description |
---|---|
cdsidsSet | a parameter |
public static String[] convertHashSetIntoArray(HashSet<String> cdsidsSet)
//package com.java2s; import java.util.HashSet; import java.util.Iterator; public class Main { /**// w w w . j a v a2s . c o m * Eliminate duplicate CDSIDs * @param cdsidsSet * @return */ public static String[] convertHashSetIntoArray(HashSet<String> cdsidsSet) { String[] cdsids = new String[cdsidsSet.size()]; if (cdsidsSet.size() > 0) { Iterator it = cdsidsSet.iterator(); int x = 0; while (it.hasNext()) { cdsids[x++] = (String) it.next(); } } return cdsids; } }