102 * <p>This class is a member of the
103 * <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework">
104 * Java Collections Framework</a>.
105 *
106 * @param <E> the type of elements maintained by this set
107 *
108 * @author Josh Bloch
109 * @see Object#hashCode()
110 * @see Collection
111 * @see Set
112 * @see HashSet
113 * @see TreeSet
114 * @see Hashtable
115 * @since 1.4
116 */
117
118 public class LinkedHashSet<E>
119 extends HashSet<E>
120 implements Set<E>, Cloneable, java.io.Serializable {
121
122 private static final long serialVersionUID = -2851667679971038690L;
123
124 /**
125 * Constructs a new, empty linked hash set with the specified initial
126 * capacity and load factor.
127 *
128 * @param initialCapacity the initial capacity of the linked hash set
129 * @param loadFactor the load factor of the linked hash set
130 * @throws IllegalArgumentException if the initial capacity is less
131 * than zero, or if the load factor is nonpositive
132 */
133 public LinkedHashSet(int initialCapacity, float loadFactor) {
134 super(initialCapacity, loadFactor, true);
135 }
136
137 /**
138 * Constructs a new, empty linked hash set with the specified initial
139 * capacity and the default load factor (0.75).
140 *
141 * @param initialCapacity the initial capacity of the LinkedHashSet
|
102 * <p>This class is a member of the
103 * <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework">
104 * Java Collections Framework</a>.
105 *
106 * @param <E> the type of elements maintained by this set
107 *
108 * @author Josh Bloch
109 * @see Object#hashCode()
110 * @see Collection
111 * @see Set
112 * @see HashSet
113 * @see TreeSet
114 * @see Hashtable
115 * @since 1.4
116 */
117
118 public class LinkedHashSet<E>
119 extends HashSet<E>
120 implements Set<E>, Cloneable, java.io.Serializable {
121
122 @java.io.Serial
123 private static final long serialVersionUID = -2851667679971038690L;
124
125 /**
126 * Constructs a new, empty linked hash set with the specified initial
127 * capacity and load factor.
128 *
129 * @param initialCapacity the initial capacity of the linked hash set
130 * @param loadFactor the load factor of the linked hash set
131 * @throws IllegalArgumentException if the initial capacity is less
132 * than zero, or if the load factor is nonpositive
133 */
134 public LinkedHashSet(int initialCapacity, float loadFactor) {
135 super(initialCapacity, loadFactor, true);
136 }
137
138 /**
139 * Constructs a new, empty linked hash set with the specified initial
140 * capacity and the default load factor (0.75).
141 *
142 * @param initialCapacity the initial capacity of the LinkedHashSet
|