public class OrderedSet extends Object implements 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(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(Object o) |
boolean |
addAll(Collection c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
boolean |
isEmpty() |
Iterator |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
boolean |
retainAll(Collection c) |
int |
size() |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, spliteratorparallelStream, removeIf, streampublic OrderedSet()
public OrderedSet(Collection c)
c - the collection whose elements are to be placed into this set.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.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.IllegalArgumentException - if the initial capacity is less than
zero.public int size()
size in interface Collectionsize in interface Setpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Setpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Setpublic Iterator iterator()
public Object[] toArray()
toArray in interface CollectiontoArray in interface Setpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Setpublic boolean add(Object o)
add in interface Collectionadd in interface Setpublic boolean remove(Object o)
remove in interface Collectionremove in interface Setpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Setpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface Setpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Setpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Setpublic void clear()
clear in interface Collectionclear in interface SetCopyright © 2010 - 2020 Adobe. All Rights Reserved