Interface MutableShortBag
- All Superinterfaces:
MutableShortCollection
,PrimitiveIterable
,ShortBag
,ShortIterable
- All Known Implementing Classes:
ShortHashBag
,SynchronizedShortBag
,UnmodifiableShortBag
public interface MutableShortBag extends MutableShortCollection, ShortBag
This file was automatically generated from template file mutablePrimitiveBag.stg.
- Since:
- 3.0.
-
Method Summary
Modifier and Type Method Description void
addOccurrences(short item, int occurrences)
MutableShortBag
asSynchronized()
MutableShortBag
asUnmodifiable()
MutableList<ShortIntPair>
bottomOccurrences(int count)
Returns thecount
least frequently occurring items.<V> MutableBag<V>
collect(ShortToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.default MutableShortBag
newEmpty()
Creates a new empty mutable version of the same Bag type.MutableShortBag
reject(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.boolean
removeOccurrences(short item, int occurrences)
MutableShortBag
select(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.MutableShortBag
selectByOccurrences(IntPredicate predicate)
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.default MutableShortBag
selectDuplicates()
Returns all elements of the bag that have more than one occurrence.MutableShortSet
selectUnique()
Returns all elements of the bag that have exactly one occurrence.default MutableShortBag
tap(ShortProcedure procedure)
ImmutableShortBag
toImmutable()
Returns an immutable copy of this bag.MutableList<ShortIntPair>
topOccurrences(int count)
Returns thecount
most frequently occurring items.MutableShortBag
with(short element)
MutableShortBag
withAll(ShortIterable elements)
MutableShortBag
without(short element)
MutableShortBag
withoutAll(ShortIterable elements)
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableShortCollection
add, addAll, addAll, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
Methods inherited from interface org.eclipse.collections.api.bag.primitive.ShortBag
equals, forEachWithOccurrences, hashCode, occurrencesOf, sizeDistinct, toStringOfItemToCount
Methods inherited from interface org.eclipse.collections.api.ShortIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList
-
Method Details
-
addOccurrences
void addOccurrences(short item, int occurrences) -
removeOccurrences
boolean removeOccurrences(short item, int occurrences) -
tap
- Specified by:
tap
in interfaceMutableShortCollection
- Specified by:
tap
in interfaceShortBag
- Specified by:
tap
in interfaceShortIterable
- Since:
- 9.0.
-
selectByOccurrences
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrences
in interfaceShortBag
- Since:
- 8.0
-
selectDuplicates
Returns all elements of the bag that have more than one occurrence.- Specified by:
selectDuplicates
in interfaceShortBag
- Since:
- 9.2
-
selectUnique
MutableShortSet selectUnique()Returns all elements of the bag that have exactly one occurrence.- Specified by:
selectUnique
in interfaceShortBag
- Since:
- 9.2
-
topOccurrences
Returns thecount
most frequently occurring items. In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last item will be returned.- Specified by:
topOccurrences
in interfaceShortBag
- Since:
- 8.0
-
bottomOccurrences
Returns thecount
least frequently occurring items. In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last item will be returned.- Specified by:
bottomOccurrences
in interfaceShortBag
- Since:
- 8.0
-
select
Description copied from interface:ShortIterable
Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.- Specified by:
select
in interfaceMutableShortCollection
- Specified by:
select
in interfaceShortBag
- Specified by:
select
in interfaceShortIterable
-
reject
Description copied from interface:ShortIterable
Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.- Specified by:
reject
in interfaceMutableShortCollection
- Specified by:
reject
in interfaceShortBag
- Specified by:
reject
in interfaceShortIterable
-
collect
Description copied from interface:ShortIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceMutableShortCollection
- Specified by:
collect
in interfaceShortBag
- Specified by:
collect
in interfaceShortIterable
-
with
- Specified by:
with
in interfaceMutableShortCollection
-
without
- Specified by:
without
in interfaceMutableShortCollection
-
withAll
- Specified by:
withAll
in interfaceMutableShortCollection
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableShortCollection
-
asUnmodifiable
MutableShortBag asUnmodifiable()- Specified by:
asUnmodifiable
in interfaceMutableShortCollection
-
asSynchronized
MutableShortBag asSynchronized()- Specified by:
asSynchronized
in interfaceMutableShortCollection
-
toImmutable
ImmutableShortBag toImmutable()Returns an immutable copy of this bag.- Specified by:
toImmutable
in interfaceMutableShortCollection
- Specified by:
toImmutable
in interfaceShortBag
-
newEmpty
Creates a new empty mutable version of the same Bag type.- Specified by:
newEmpty
in interfaceMutableShortCollection
- Since:
- 9.2.
-