Top Description Methods
org.eclipse.collections.api.bag.primitive

public Interface MutableShortBag

extends MutableShortCollection, ShortBag
Imports
org.eclipse.collections.api.ShortIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.block.function.primitive.ShortToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.IntPredicate, .ShortPredicate, org.eclipse.collections.api.block.procedure.primitive.ShortProcedure, org.eclipse.collections.api.collection.primitive.MutableShortCollection, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.tuple.primitive.ShortIntPair, org.eclipse.collections.api.set.primitive.MutableShortSet

This file was automatically generated from template file mutablePrimitiveBag.stg.
Since
3.0.

Method Summary

Modifier and TypeMethod and Description
public void
addOccurrences(short item, int occurrences)

public MutableShortBag
public MutableShortBag
public MutableList<ShortIntPair>
bottomOccurrences(int count)

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.bottomOccurrences.

Returns the count least frequently occurring items.

public <V> MutableBag<V>
collect(ShortToObjectFunction<? extends V> function)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.collect, org.eclipse.collections.api.bag.primitive.ShortBag.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public default MutableShortBag
newEmpty()

Overrides default org.eclipse.collections.api.collection.primitive.MutableShortCollection.newEmpty.

Creates a new empty mutable version of the same Bag type.

public MutableShortBag
reject(ShortPredicate predicate)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.reject, org.eclipse.collections.api.bag.primitive.ShortBag.reject.

Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.

public boolean
removeOccurrences(short item, int occurrences)

public MutableShortBag
select(ShortPredicate predicate)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.select, org.eclipse.collections.api.bag.primitive.ShortBag.select.

Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.

public MutableShortBag
selectByOccurrences(IntPredicate predicate)

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

public default MutableShortBag
selectDuplicates()

Overrides default org.eclipse.collections.api.bag.primitive.ShortBag.selectDuplicates.

Returns all elements of the bag that have more than one occurrence.

public MutableShortSet
selectUnique()

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.selectUnique.

Returns all elements of the bag that have exactly one occurrence.

public default MutableShortBag
public ImmutableShortBag
public MutableList<ShortIntPair>
topOccurrences(int count)

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.topOccurrences.

Returns the count most frequently occurring items.

public MutableShortBag
public MutableShortBag
public MutableShortBag
public MutableShortBag
Inherited from org.eclipse.collections.api.bag.primitive.ShortBag:
equalsforEachWithOccurrenceshashCodeoccurrencesOfsizeDistincttoStringOfItemToCount
Inherited from org.eclipse.collections.api.collection.primitive.MutableShortCollection:
addaddAlladdAllclearremoveremoveAllremoveAllremoveIfretainAllretainAllshortIterator

Method Detail

addOccurrencesback to summary
public void addOccurrences(short item, int occurrences)
asSynchronizedback to summary
public MutableShortBag asSynchronized()

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.asSynchronized.

Annotations
@Override
asUnmodifiableback to summary
public MutableShortBag asUnmodifiable()

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.asUnmodifiable.

Annotations
@Override
bottomOccurrencesback to summary
public MutableList<ShortIntPair> bottomOccurrences(int count)

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.bottomOccurrences.

Returns the count 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.

Annotations
@Override
Since
8.0
collectback to summary
public <V> MutableBag<V> collect(ShortToObjectFunction<? extends V> function)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.collect, org.eclipse.collections.api.bag.primitive.ShortBag.collect.

Doc from org.eclipse.collections.api.ShortIterable.collect.

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.

Annotations
@Override
newEmptyback to summary
public default MutableShortBag newEmpty()

Overrides default org.eclipse.collections.api.collection.primitive.MutableShortCollection.newEmpty.

Creates a new empty mutable version of the same Bag type.

Since
9.2.
rejectback to summary
public MutableShortBag reject(ShortPredicate predicate)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.reject, org.eclipse.collections.api.bag.primitive.ShortBag.reject.

Doc from org.eclipse.collections.api.ShortIterable.reject.

Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.

Annotations
@Override
removeOccurrencesback to summary
public boolean removeOccurrences(short item, int occurrences)
selectback to summary
public MutableShortBag select(ShortPredicate predicate)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.select, org.eclipse.collections.api.bag.primitive.ShortBag.select.

Doc from org.eclipse.collections.api.ShortIterable.select.

Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.

Annotations
@Override
selectByOccurrencesback to summary
public MutableShortBag selectByOccurrences(IntPredicate predicate)

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

Annotations
@Override
Since
8.0
selectDuplicatesback to summary
public default MutableShortBag selectDuplicates()

Overrides default org.eclipse.collections.api.bag.primitive.ShortBag.selectDuplicates.

Returns all elements of the bag that have more than one occurrence.

Annotations
@Override
Since
9.2
selectUniqueback to summary
public MutableShortSet selectUnique()

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.selectUnique.

Returns all elements of the bag that have exactly one occurrence.

Annotations
@Override
Since
9.2
tapback to summary
public default MutableShortBag tap(ShortProcedure procedure)

Overrides default org.eclipse.collections.api.collection.primitive.MutableShortCollection.tap, org.eclipse.collections.api.bag.primitive.ShortBag.tap.

Annotations
@Override
Since
9.0.
toImmutableback to summary
public ImmutableShortBag toImmutable()

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.toImmutable, org.eclipse.collections.api.bag.primitive.ShortBag.toImmutable.

Returns an immutable copy of this bag.

Annotations
@Override
topOccurrencesback to summary
public MutableList<ShortIntPair> topOccurrences(int count)

Redeclares org.eclipse.collections.api.bag.primitive.ShortBag.topOccurrences.

Returns the count 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.

Annotations
@Override
Since
8.0
withback to summary
public MutableShortBag with(short element)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.with.

Annotations
@Override
withAllback to summary
public MutableShortBag withAll(ShortIterable elements)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.withAll.

Annotations
@Override
withoutback to summary
public MutableShortBag without(short element)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.without.

Annotations
@Override
withoutAllback to summary
public MutableShortBag withoutAll(ShortIterable elements)

Redeclares org.eclipse.collections.api.collection.primitive.MutableShortCollection.withoutAll.

Annotations
@Override