Interface MutableBagFactory
public interface MutableBagFactory
A factory which creates instances of type
MutableBag.-
Method Summary
Modifier and TypeMethodDescription<T> MutableBag<T>empty()<T> MutableBag<T>fromStream(Stream<? extends T> stream) default <T> MutableBag<T>of()Same asempty().default <T> MutableBag<T>of(T... elements) Same aswith(Object[]).default <T> MutableBag<T>Same aswithAll(Iterable).default <T> MutableBag<T>ofInitialCapacity(int capacity) Same asempty(). but takes in initial capacity.default <T> MutableBag<T>ofOccurrences(ObjectIntPair<T>... elementsWithOccurrences) Same aswithOccurrences(ObjectIntPair[]).default <T> MutableBag<T>ofOccurrences(T element, int occurrence) Same aswithOccurrences(Object, int).default <T> MutableBag<T>ofOccurrences(T element1, int occurrence1, T element2, int occurrence2) default <T> MutableBag<T>ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) default <T> MutableBag<T>ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4) default <T> MutableBag<T>with()Same asempty().<T> MutableBag<T>with(T... elements) <T> MutableBag<T>default <T> MutableBag<T>withInitialCapacity(int capacity) Same asempty(). but takes in initial capacity.default <T> MutableBag<T>withOccurrences(ObjectIntPair<T>... elementsWithOccurrences) default <T> MutableBag<T>withOccurrences(T element, int occurrence) default <T> MutableBag<T>withOccurrences(T element1, int occurrence1, T element2, int occurrence2) default <T> MutableBag<T>withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) default <T> MutableBag<T>withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4)
-
Method Details
-
empty
- Since:
- 6.0
-
of
Same asempty(). -
with
Same asempty(). -
of
Same aswith(Object[]). -
ofOccurrences
Same aswithOccurrences(Object, int).- Since:
- 10.3
-
ofOccurrences
- Since:
- 10.3
-
ofOccurrences
default <T> MutableBag<T> ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) - Since:
- 10.3
-
ofOccurrences
default <T> MutableBag<T> ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4) - Since:
- 10.3
-
ofOccurrences
Same aswithOccurrences(ObjectIntPair[]).- Since:
- 10.3
-
with
-
withOccurrences
- Since:
- 10.3
-
withOccurrences
- Since:
- 10.3
-
withOccurrences
default <T> MutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) - Since:
- 10.3
-
withOccurrences
default <T> MutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4) - Since:
- 10.3
-
withOccurrences
- Since:
- 10.3
-
ofAll
Same aswithAll(Iterable). -
withAll
-
fromStream
- Since:
- 10.0.
-
ofInitialCapacity
Same asempty(). but takes in initial capacity.- Since:
- 11.1.
-
withInitialCapacity
Same asempty(). but takes in initial capacity.- Since:
- 11.1.
-