Lines Matching refs:elements
50 * Creates a {@code HashSet} instance containing the given elements.
62 * @param elements the elements that the set should contain
63 * @return a newly-created {@code HashSet} containing those elements (minus
66 public static <E> HashSet<E> newHashSet(E... elements) {
67 int capacity = elements.length * 4 / 3 + 1;
69 Collections.addAll(set, elements);
83 * Creates a {@code SortedSet} instance containing the given elements.
85 * @param elements the elements that the set should contain
86 * @return a newly-created {@code SortedSet} containing those elements (minus
89 public static <E> SortedSet<E> newSortedSet(E... elements) {
91 Collections.addAll(set, elements);
103 * Creates a {@code ArraySet} instance containing the given elements.
105 public static <E> ArraySet<E> newArraySet(E... elements) {
106 int capacity = elements.length * 4 / 3 + 1;
108 Collections.addAll(set, elements);