Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public class UnionSet<E> extends AbstractSet<E>
In order to efficiently provide a union of fewer, larger sets, this provides a
set view on top of other sets. Any set that is added to this union set via
addAll(Set) must not be modified after being added. For
performance purposes, defensive copying is not performed.
| Constructor and Description |
|---|
UnionSet() |
UnionSet(Collection<? extends E> c) |
UnionSet(Set<? extends E> set) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> c)
Triggers combining.
|
void |
addAll(Set<? extends E> set)
If the set has size > MAXIMUM_COMBINE_SIZE, the set will be added to the
added list, which may then be later combined only when needed. |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
isEmpty() |
Iterator<E> |
iterator()
Triggers combining.
|
boolean |
remove(Object o)
Triggers combining.
|
boolean |
removeAll(Collection<?> c)
Triggers combining.
|
boolean |
retainAll(Collection<?> c)
Triggers combining.
|
int |
size()
Triggers combining.
|
Object[] |
toArray()
Triggers combining.
|
<T> T[] |
toArray(T[] a)
Triggers combining.
|
equals, hashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitspliteratorparallelStream, removeIf, streampublic UnionSet()
public UnionSet(Collection<? extends E> c)
public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public Iterator<E> iterator()
public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>public boolean add(E e)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<E>containsAll in class AbstractCollection<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface Set<E>addAll in class AbstractCollection<E>addAll(java.util.Set)public void addAll(Set<? extends E> set)
added list, which may then be later combined only when needed.
Because of this potentially delayed combining, any set added should not be
subsequently altered.public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface Set<E>retainAll in class AbstractCollection<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<E>removeAll in class AbstractSet<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.