Interface XBag<E>
-
- All Superinterfaces:
CapacityCarrying
,CapacityExtendable
,Clearable
,ConsolidatableCollection
,Consumer<E>
,Copyable
,ExtendedBag<E>
,ExtendedCollection<E>
,Iterable<E>
,OptimizableCollection
,Processable<E>
,ReleasingCollection<E>
,Sized
,Truncateable
,XAddGetCollection<E>
,XAddingBag<E>
,XAddingCollection<E>
,XCollection<E>
,XGettingBag<E>
,XGettingCollection<E>
,XIterable<E>
,XJoinable<E>
,XProcessingBag<E>
,XProcessingCollection<E>
,XPutGetBag<E>
,XPutGetCollection<E>
,XPuttingBag<E>
,XPuttingCollection<E>
,XRemovingBag<E>
,XRemovingCollection<E>
- All Known Subinterfaces:
XBasicList<E>
,XLadder<E>
,XList<E>
- All Known Implementing Classes:
ArrayCollector
,BulkList
,EqBulkList
,LimitList
,LockedList
,Single
,SubList
,SynchList
public interface XBag<E> extends XPutGetBag<E>, XProcessingBag<E>, XCollection<E>
Bag type collections make the single demand (thus being a level 1 collection type) that duplicate elements have to be allowed, effectively being the opposite to set type collections.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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
XBag.Factory<E>
-
Nested classes/interfaces inherited from interface one.microstream.typing.Copyable
Copyable.Static
-
Nested classes/interfaces inherited from interface one.microstream.collections.interfaces.ExtendedCollection
ExtendedCollection.Creator<E,C extends ExtendedCollection<E>>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingCollection
XGettingCollection.Creator<E>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XIterable
XIterable.Executor<E>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XPutGetCollection
XPutGetCollection.Creator<E>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XPuttingBag
XPuttingBag.Creator<E>
-
-
Method Summary
Modifier and Type Method 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)
XBag<E>
putAll(E[] elements, int srcStartIndex, int srcLength)
XBag<E>
putAll(XGettingCollection<? extends E> elements)
-
Methods inherited from interface one.microstream.collections.interfaces.CapacityCarrying
isFull, maximumCapacity, remainingCapacity
-
Methods inherited from interface one.microstream.collections.interfaces.CapacityExtendable
currentCapacity, currentFreeCapacity, ensureCapacity, ensureFreeCapacity
-
Methods inherited from interface one.microstream.collections.interfaces.ExtendedCollection
nullAllowed
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface one.microstream.functional.Processable
process
-
Methods inherited from interface one.microstream.collections.types.XAddingCollection
accept, add, nullAdd
-
Methods inherited from interface one.microstream.collections.types.XCollection
collector
-
Methods inherited from interface one.microstream.collections.types.XGettingCollection
applies, 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, union
-
Methods inherited from interface one.microstream.collections.types.XProcessingBag
immure, view
-
Methods inherited from interface one.microstream.collections.types.XProcessingCollection
fetch, iterate, moveTo, pinch, removeBy, removeDuplicates, retrieve, retrieveBy
-
Methods inherited from interface one.microstream.collections.types.XPuttingCollection
nullPut, put
-
Methods inherited from interface one.microstream.collections.types.XRemovingCollection
clear, consolidate, nullRemove, optimize, remove, removeAll, removeDuplicates, removeOne, retainAll, truncate
-
-
-
-
Method Detail
-
putAll
XBag<E> putAll(E... elements)
- Specified by:
putAll
in interfaceXCollection<E>
- Specified by:
putAll
in interfaceXPutGetCollection<E>
- Specified by:
putAll
in interfaceXPuttingBag<E>
- Specified by:
putAll
in interfaceXPuttingCollection<E>
-
putAll
XBag<E> putAll(E[] elements, int srcStartIndex, int srcLength)
- Specified by:
putAll
in interfaceXCollection<E>
- Specified by:
putAll
in interfaceXPutGetCollection<E>
- Specified by:
putAll
in interfaceXPuttingBag<E>
- Specified by:
putAll
in interfaceXPuttingCollection<E>
-
putAll
XBag<E> putAll(XGettingCollection<? extends E> elements)
- Specified by:
putAll
in interfaceXCollection<E>
- Specified by:
putAll
in interfaceXPutGetCollection<E>
- Specified by:
putAll
in interfaceXPuttingBag<E>
- Specified by:
putAll
in interfaceXPuttingCollection<E>
-
addAll
XBag<E> addAll(E... elements)
- Specified by:
addAll
in interfaceXAddGetCollection<E>
- Specified by:
addAll
in interfaceXAddingBag<E>
- Specified by:
addAll
in interfaceXAddingCollection<E>
- Specified by:
addAll
in interfaceXCollection<E>
- Specified by:
addAll
in interfaceXPutGetCollection<E>
- Specified by:
addAll
in interfaceXPuttingBag<E>
-
addAll
XBag<E> addAll(E[] elements, int srcStartIndex, int srcLength)
- Specified by:
addAll
in interfaceXAddGetCollection<E>
- Specified by:
addAll
in interfaceXAddingBag<E>
- Specified by:
addAll
in interfaceXAddingCollection<E>
- Specified by:
addAll
in interfaceXCollection<E>
- Specified by:
addAll
in interfaceXPutGetCollection<E>
- Specified by:
addAll
in interfaceXPuttingBag<E>
-
addAll
XBag<E> addAll(XGettingCollection<? extends E> elements)
- Specified by:
addAll
in interfaceXAddGetCollection<E>
- Specified by:
addAll
in interfaceXAddingBag<E>
- Specified by:
addAll
in interfaceXAddingCollection<E>
- Specified by:
addAll
in interfaceXCollection<E>
- Specified by:
addAll
in interfaceXPutGetCollection<E>
- Specified by:
addAll
in interfaceXPuttingBag<E>
-
copy
XBag<E> copy()
Description copied from interface:XGettingCollection
Creates a true copy of this collection which references the same elements as this collection does at the time the method is called. The elements themselves are NOT copied (no deep copying).
The type of the returned set is the same as of this list if possible.- Specified by:
copy
in interfaceCopyable
- Specified by:
copy
in interfaceXAddGetCollection<E>
- Specified by:
copy
in interfaceXCollection<E>
- Specified by:
copy
in interfaceXGettingBag<E>
- Specified by:
copy
in interfaceXGettingCollection<E>
- Specified by:
copy
in interfaceXProcessingBag<E>
- Specified by:
copy
in interfaceXPutGetCollection<E>
- Returns:
- a copy of this list
-
-