E - the type of the elements in this setpublic class LazySetUnion<E> extends AbstractSet<E>
Set view for the union of elements of two sets. The
resulted set is backed by the input sets, so changes to any of the sets are
reflected in the union. The main purpose of the class is to facilitate
iteration and checking the membership over union of sets without computing
the set explicitly (and thus potentially saving memory). When iterating over
the union, the common elements of the two sets are iterated only once. An
element is contained in the union as reported by contains if it is
contained in one of the input sets. The size of the union reported by
size is the sum of the sizes for the sets. This way it is possible to
use the result to build other LazySetIntersection and
LazySetUnion objects. If any of the sets is modified while an
iteration over the union is in progress, the results of the iteration are
undefined. The set union does not support additions or removal of elements;
if attempted, an UnsupportedOperationException will be thrown.LazySetIntersection| Constructor and Description |
|---|
LazySetUnion(Set<? extends E> firstSet,
Set<? extends E> secondSet)
Returns a new
Set view for union of two input sets. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Object o) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object o) |
int |
size() |
equals, hashCode, removeAlladd, addAll, clear, containsAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, containsAll, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streampublic boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>contains 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 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>Copyright © 2011–2024 Live Ontologies Project. All rights reserved.