public class OrderedSet
extends java.lang.Object
implements java.util.Set
Constructor and Description |
---|
OrderedSet()
Constructs a new, empty set; the backing HashMap instance has
default initial capacity (16) and load factor (0.75).
|
OrderedSet(java.util.Collection c)
Constructs a new set containing the elements in the specified collection.
|
OrderedSet(int initialCapacity)
Constructs a new, empty set; the backing Set instance has
the specified initial capacity and default load factor, which is
0.75.
|
OrderedSet(int initialCapacity,
float loadFactor)
Constructs a new, empty set; the backing Set instance has
the specified initial capacity and the specified load factor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Object o) |
boolean |
addAll(java.util.Collection c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
boolean |
isEmpty() |
java.util.Iterator |
iterator() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
boolean |
retainAll(java.util.Collection c) |
int |
size() |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
public OrderedSet()
public OrderedSet(java.util.Collection c)
c
- the collection whose elements are to be placed into this set.java.lang.NullPointerException
- if the specified collection is null.public OrderedSet(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the hash map.loadFactor
- the load factor of the hash map.java.lang.IllegalArgumentException
- if the initial capacity is less than
zero, or if the load factor is nonpositive.public OrderedSet(int initialCapacity)
initialCapacity
- the initial capacity of the hash table.java.lang.IllegalArgumentException
- if the initial capacity is less than
zero.public int size()
size
in interface java.util.Collection
size
in interface java.util.Set
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.Set
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
contains
in interface java.util.Set
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.Set
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.Set
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.Set
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.Set
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.Set
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.Set
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.Set
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.Set
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.Set
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"