public class BoundedSet<E>
extends com.google.common.collect.ForwardingSet<E>
Constructor and Description |
---|
BoundedSet(int maximumSize)
Creates a
HashSet -backed bounded set. |
BoundedSet(Set<E> delegate,
int maximumSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> c) |
void |
clear() |
protected Set<E> |
delegate() |
Iterator<E> |
iterator()
The returned iterator does not support removal.
|
boolean |
offer(E e)
Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
|
E |
poll()
See
Queue.poll()
Retrieves and removes the head of this queue,
or returns null if this queue is empty. |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
equals, hashCode, standardEquals, standardHashCode, standardRemoveAll
contains, containsAll, isEmpty, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contains, containsAll, isEmpty, size, spliterator, toArray, toArray
parallelStream, removeIf, stream
public BoundedSet(int maximumSize)
HashSet
-backed bounded set.protected Set<E> delegate()
delegate
in class com.google.common.collect.ForwardingSet<E>
public boolean add(E e)
public boolean remove(Object o)
public boolean addAll(@NotNull Collection<? extends E> c)
public boolean retainAll(@NotNull Collection<?> c)
public boolean removeAll(@NotNull Collection<?> c)
public void clear()
@Nullable public E poll()
Queue.poll()
Retrieves and removes the head of this queue,
or returns null
if this queue is empty.
WARNING: unlike Queue's poll() there is no guarantee that the items will
be polled in the same order as added.public boolean offer(E e)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.