Java Array to Set arrayToSet(Object[] in)

Here you can find the source of arrayToSet(Object[] in)

Description

{ method

License

Apache License

Parameter

Parameter Description
in - non-null arrsy to place

Return

non-null set }

Declaration

public static Set arrayToSet(Object[] in) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    /**{ method/*from   w w w. j  a  va  2 s. co m*/
     @name arrayToSet
     @function convert an
     @param in - non-null arrsy to place
     @return  non-null set
     }*/
    public static Set arrayToSet(Object[] in) {
        Set ret = new HashSet();
        for (int i = 0; i < in.length; i++)
            ret.add(in[i]);
        return (ret);
    }
}

Related

  1. arrayToSet(final T[] array)
  2. toSet(final TYPE[] array)
  3. toSet(T[] array)
  4. translateToSet(T[] array)