01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package java.util;
17:
18: /**
19: * Hash table and linked-list implementation of the Set interface with
20: * predictable iteration order. <a
21: * href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/LinkedHashSet.html">[Sun
22: * docs]</a>
23: *
24: * @param <E> element type.
25: */
26: public class LinkedHashSet<E> extends HashSet<E> implements Set<E>,
27: Cloneable {
28:
29: public LinkedHashSet() {
30: super (new LinkedHashMap<E, Object>(16, .75f));
31: }
32:
33: /**
34: * @param c
35: */
36: public LinkedHashSet(Collection<? extends E> c) {
37: super (new LinkedHashMap<E, Object>(16, .75f));
38: addAll(c);
39: }
40:
41: /**
42: * @param initialCapacity
43: */
44: public LinkedHashSet(int initialCapacity) {
45: super (new LinkedHashMap<E, Object>(initialCapacity, .75f));
46: }
47:
48: /**
49: * @param initialCapacity
50: * @param loadFactor
51: */
52: public LinkedHashSet(int initialCapacity, float loadFactor) {
53: super (new LinkedHashMap<E, Object>(initialCapacity, loadFactor));
54: }
55:
56: }
|