Java Utililty Methods Set to

List of utility methods to do Set to

Description

The list of methods to do Set to are organized into topic(s).

Method

int[]toIntArray(Set is)
to Int Array
int[] rslt = new int[is.size()];
Iterator<Integer> iter = is.iterator();
for (int i = 0; i < rslt.length; i++) {
    Integer x = iter.next();
    if (x != null) {
        rslt[i] = x;
return rslt;
SettoUnmodifiableSet(final Collection source)
to Unmodifiable Set
if (source instanceof Set) {
    return Collections.unmodifiableSet(CAST(source));
return Collections.unmodifiableSet(linkedSet(source));
SettoUnmodifiableSet(String... values)
to Unmodifiable Set
return Collections.unmodifiableSet(new HashSet<String>(Arrays.<String>asList(values)));