Java HashSet Create stringArrayToHashset(String[] strings)

Here you can find the source of stringArrayToHashset(String[] strings)

Description

A function for converting string arrays to HashSets of strings, provided as a convenience for preparing string arrays for TNRS.

License

Open Source License

Parameter

Parameter Description
input strings

Return

a set of Strings containing the input

Declaration

public static HashSet<String> stringArrayToHashset(String[] strings) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    /**/* w  ww . j  a  v  a  2 s.co  m*/
     * A function for converting string arrays to HashSets of strings, provided as a convenience for preparing string arrays for TNRS.
     * @param input strings
     * @return a set of Strings containing the input
     */
    public static HashSet<String> stringArrayToHashset(String[] strings) {
        HashSet<String> stringSet = new HashSet<String>();
        for (int i = 0; i < strings.length; i++) {
            stringSet.add(strings[i]);
        }
        return stringSet;
    }
}

Related

  1. newHashSet(E... elements)
  2. newHashSetOnNull(Set set)
  3. print_bigrams(HashSet bigrams)
  4. printlnStringHashSet(HashSet hashSet)
  5. select(HashSet S)
  6. toHashSet(Object[] array)
  7. toHashSet(Set inp)