Package org.apache.juneau.internal
Class MultiSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.apache.juneau.internal.MultiSet<E>
- Type Parameters:
E
- The object type of this set.
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
Encapsulates multiple collections so they can be iterated over as if they were all part of the same collection.
See Also:
-
Constructor Summary
ConstructorDescriptionMultiSet
(Collection<E>... c) Create a new Set that consists as a coalesced set of the specified collections. -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
MultiSet
Create a new Set that consists as a coalesced set of the specified collections.- Parameters:
c
- Zero or more collections to add to this set.
-
-
Method Details
-
iterator
Iterates over all entries in all collections. -
enumerator
Enumerates over all entries in all collections.- Returns:
- An enumeration wrapper around this set.
-
size
- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceSet<E>
- Specified by:
size
in classAbstractCollection<E>
-