E
- the type of elements maintained by this setpublic class MaxSizeConcurrentHashSet<E> extends Object implements Set<E>, Serializable
Constructor and Description |
---|
MaxSizeConcurrentHashSet()
Create a ConcurrentHashSet with no maximum size.
|
MaxSizeConcurrentHashSet(int maxSize)
Create a ConcurrentHashSet with the maximum size given.
|
MaxSizeConcurrentHashSet(Set<? extends E> s)
Create a ConcurrentHashSet with the elements in s.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
Adds the element if the set is not already full.
|
boolean |
addAll(Collection<? extends E> c)
Add all the items.
|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o) |
void |
forEach(Consumer<? super E> action) |
int |
getMaxSize() |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
Stream<E> |
parallelStream() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
removeIf(Predicate<? super E> filter) |
boolean |
retainAll(Collection<?> c) |
void |
setMaxSize(int maxSize) |
int |
size() |
Spliterator<E> |
spliterator() |
Stream<E> |
stream() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
public MaxSizeConcurrentHashSet()
public MaxSizeConcurrentHashSet(int maxSize)
public int getMaxSize()
public void setMaxSize(int maxSize)
public boolean add(E e)
add
in interface Collection<E>
add
in interface Set<E>
e
- The elementpublic void clear()
public int size()
public boolean isEmpty()
public boolean contains(Object o)
public boolean remove(Object o)
public Object[] toArray()
public <T> T[] toArray(T[] a)
public int hashCode()
public boolean equals(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public boolean addAll(Collection<? extends E> c)
public boolean removeIf(Predicate<? super E> filter)
removeIf
in interface Collection<E>
public Spliterator<E> spliterator()
spliterator
in interface Iterable<E>
spliterator
in interface Collection<E>
spliterator
in interface Set<E>
public Stream<E> stream()
stream
in interface Collection<E>
public Stream<E> parallelStream()
parallelStream
in interface Collection<E>