ICU-4700 additions for CLDRFile

X-SVN-Rev: 18739
This commit is contained in:
Mark Davis 2005-10-31 04:55:04 +00:00
parent 5796eb1aca
commit 40d9cff7f6

View File

@ -21,6 +21,9 @@ import com.ibm.icu.text.UTF16;
import com.ibm.icu.text.UnicodeSet;
import com.ibm.icu.text.UnicodeSetIterator;
/**
* Utilities that ought to be on collections, but aren't
*/
public final class CollectionUtilities {
/**
* Utility like Arrays.asList()
@ -36,6 +39,13 @@ public final class CollectionUtilities {
return target;
}
public static Collection addAll(Collection target, Iterator source) {
while (source.hasNext()) {
target.add(source.next());
}
return target; // for chaining
}
public static Map asMap(Object[][] source) {
return asMap(source, new HashMap(), false);
}