E - type of contained elementspublic interface XBag<E> extends XPutGetBag<E>, XProcessingBag<E>, XCollection<E>
The naming for the type is based on the conception that a bag can contain any elements (including duplicates), but is definitely not ordered.
Apologies to the Apache guys (but honestly: why should the conception of a "bag" imply that its contained elements are counted? Apart from that, counting elements is such a specific addon logic, that the proper approach would be to extend an existing type, like CountingList, etc. but surely not "bag", which implies unordered content).
This will probably be a rather academic type and has been introduced more for reasons of completeness of the typing architecture, as in practice, list type collections will be preferred to pure bag type collections.
Bag type collections are architectural on par with the other level 1 collection types set and sequence.
Currently, the only known to be useful subtype of a bag is the level 2 collection type list, combining bag and sequence (order of elements).
| Modifier and Type | Interface and Description |
|---|---|
static interface |
XBag.Factory<E> |
XPuttingBag.Creator<E>XPutGetCollection.Creator<E>XIterable.Executor<E>Copyable.Static| Modifier and Type | Method and Description |
|---|---|
XBag<E> |
addAll(E... elements) |
XBag<E> |
addAll(E[] elements,
int srcStartIndex,
int srcLength) |
XBag<E> |
addAll(XGettingCollection<? extends E> elements) |
XBag<E> |
copy()
Creates a true copy of this collection which references the same elements as this collection does
at the time the method is called.
|
XBag<E> |
putAll(E... elements)
Adds the specified elements to this collection if it is not already present (optional operation).
|
XBag<E> |
putAll(E[] elements,
int srcStartIndex,
int srcLength)
Adds the specified elements to this collection if it is not already present (optional operation).
Only the elements with indizes from the srcStartIndex to the srcStartIndex+srcLength are put in the collection. |
XBag<E> |
putAll(XGettingCollection<? extends E> elements)
Adds the specified elements to this collection if it is not already present (optional operation).
|
immure, viewcollectorapplies, contains, containsAll, containsId, containsSearched, copyTo, count, countBy, distinct, distinct, equality, equals, equals, equalsContent, except, filterTo, get, hashCode, hasVolatileElements, intersect, intSize, iterator, join, max, min, nullContained, old, search, seek, size, toArray, toArray, unionforEach, spliteratornullPut, putaccept, add, nullAddnullAllowedcurrentCapacity, currentFreeCapacity, ensureCapacity, ensureFreeCapacityisFull, maximumCapacity, remainingCapacityfetch, iterate, moveTo, pinch, removeBy, removeDuplicates, retrieve, retrieveByprocessclear, consolidate, nullRemove, optimize, remove, removeAll, removeDuplicates, removeOne, retainAll, truncateXBag<E> putAll(E... elements)
XPuttingBag
In this implementation it is identical to XPuttingBag.addAll(Object...)
putAll in interface XCollection<E>putAll in interface XPutGetCollection<E>putAll in interface XPuttingBag<E>putAll in interface XPuttingCollection<E>elements - to addXBag<E> putAll(E[] elements, int srcStartIndex, int srcLength)
XPuttingBag
In this implementation it is identical to XPuttingBag.addAll(Object[], int, int)
putAll in interface XCollection<E>putAll in interface XPutGetCollection<E>putAll in interface XPuttingBag<E>putAll in interface XPuttingCollection<E>elements - to addsrcStartIndex - start index of elements-array to add to collectionsrcLength - length of elements-array to add to collectionXBag<E> putAll(XGettingCollection<? extends E> elements)
XPuttingBag
In this implementation it is identical to XPuttingBag.addAll(XGettingCollection)
putAll in interface XCollection<E>putAll in interface XPutGetCollection<E>putAll in interface XPuttingBag<E>putAll in interface XPuttingCollection<E>elements - to addXBag<E> addAll(E... elements)
addAll in interface XAddGetCollection<E>addAll in interface XAddingBag<E>addAll in interface XAddingCollection<E>addAll in interface XCollection<E>addAll in interface XPutGetCollection<E>addAll in interface XPuttingBag<E>XBag<E> addAll(E[] elements, int srcStartIndex, int srcLength)
addAll in interface XAddGetCollection<E>addAll in interface XAddingBag<E>addAll in interface XAddingCollection<E>addAll in interface XCollection<E>addAll in interface XPutGetCollection<E>addAll in interface XPuttingBag<E>XBag<E> addAll(XGettingCollection<? extends E> elements)
addAll in interface XAddGetCollection<E>addAll in interface XAddingBag<E>addAll in interface XAddingCollection<E>addAll in interface XCollection<E>addAll in interface XPutGetCollection<E>addAll in interface XPuttingBag<E>XBag<E> copy()
XGettingCollectioncopy in interface Copyablecopy in interface XAddGetCollection<E>copy in interface XCollection<E>copy in interface XGettingBag<E>copy in interface XGettingCollection<E>copy in interface XProcessingBag<E>copy in interface XPutGetCollection<E>Copyright © 2022 MicroStream Software. All rights reserved.