public class ConcurrentHashSet<E> extends AbstractSet<E> implements Set<E>, Serializable
| 构造器和说明 |
|---|
ConcurrentHashSet() |
ConcurrentHashSet(int initialCapacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
add(E e)
Adds the specified element to this set if it is not already present.
|
void |
clear()
Removes all of the elements from this set.
|
boolean |
contains(Object o)
Returns true if this set contains the specified element.
|
boolean |
isEmpty()
Returns true if this set contains no elements.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
remove(Object o)
Removes the specified element from this set if it is present.
|
int |
size()
Returns the number of elements in this set (its cardinality).
|
equals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringpublic ConcurrentHashSet()
public ConcurrentHashSet(int initialCapacity)
public Iterator<E> iterator()
iterator 在接口中 Iterable<E>iterator 在接口中 Collection<E>iterator 在接口中 Set<E>iterator 在类中 AbstractCollection<E>ConcurrentModificationExceptionpublic int size()
size 在接口中 Collection<E>size 在接口中 Set<E>size 在类中 AbstractCollection<E>public boolean isEmpty()
isEmpty 在接口中 Collection<E>isEmpty 在接口中 Set<E>isEmpty 在类中 AbstractCollection<E>public boolean contains(Object o)
contains 在接口中 Collection<E>contains 在接口中 Set<E>contains 在类中 AbstractCollection<E>o - element whose presence in this set is to be testedpublic boolean add(E e)
add 在接口中 Collection<E>add 在接口中 Set<E>add 在类中 AbstractCollection<E>e - element to be added to this setpublic boolean remove(Object o)
remove 在接口中 Collection<E>remove 在接口中 Set<E>remove 在类中 AbstractCollection<E>o - object to be removed from this set, if presentpublic void clear()
clear 在接口中 Collection<E>clear 在接口中 Set<E>clear 在类中 AbstractCollection<E>Copyright © 2016. All rights reserved.