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