Class UnmodifiableShortBag
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableShortCollection
org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableShortBag
- All Implemented Interfaces:
- Serializable,- MutableShortBag,- ShortBag,- MutableShortCollection,- PrimitiveIterable,- ShortIterable
public class UnmodifiableShortBag extends AbstractUnmodifiableShortCollection implements MutableShortBag
This file was automatically generated from template file unmodifiablePrimitiveBag.stg.
- Since:
- 3.1.
- See Also:
- Serialized Form
- 
Constructor SummaryConstructors Constructor Description UnmodifiableShortBag(MutableShortBag bag)
- 
Method SummaryModifier and Type Method Description voidaddOccurrences(short item, int occurrences)MutableShortBagasSynchronized()MutableShortBagasUnmodifiable()MutableList<ShortIntPair>bottomOccurrences(int count)Returns thecountleast 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.booleanequals(Object otherBag)Follows the same general contract asBag.equals(Object).voidforEachWithOccurrences(ShortIntProcedure procedure)For each distinct item, with the number of occurrences, execute the specified procedure.inthashCode()Follows the same general contract asBag.hashCode().MutableShortBagnewEmpty()Creates a new empty mutable version of the same Bag type.intoccurrencesOf(short item)The occurrences of a distinct item in the bag.MutableShortBagreject(ShortPredicate predicate)Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.booleanremoveOccurrences(short item, int occurrences)MutableShortBagselect(ShortPredicate predicate)Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.MutableShortBagselectByOccurrences(IntPredicate predicate)Returns all elements of the bag that have a number of occurrences that satisfy the predicate.MutableShortSetselectUnique()Returns all elements of the bag that have exactly one occurrence.intsizeDistinct()The size of the Bag when counting only distinct elements.ImmutableShortBagtoImmutable()Returns an immutable copy of this bag.MutableList<ShortIntPair>topOccurrences(int count)Returns thecountmost frequently occurring items.UnmodifiableShortBagwith(short element)UnmodifiableShortBagwithAll(ShortIterable elements)UnmodifiableShortBagwithout(short element)UnmodifiableShortBagwithoutAll(ShortIterable elements)Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableShortCollectionadd, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods inherited from interface org.eclipse.collections.api.bag.primitive.MutableShortBagselectDuplicates, tapMethods inherited from interface org.eclipse.collections.api.collection.primitive.MutableShortCollectionadd, addAll, addAll, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIteratorMethods inherited from interface org.eclipse.collections.api.PrimitiveIterableappendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringMethods inherited from interface org.eclipse.collections.api.bag.primitive.ShortBagtoStringOfItemToCountMethods inherited from interface org.eclipse.collections.api.ShortIterableallSatisfy, 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
- 
Constructor Details
- 
Method Details- 
with- Specified by:
- within interface- MutableShortBag
- Specified by:
- within interface- MutableShortCollection
- Overrides:
- within class- AbstractUnmodifiableShortCollection
 
- 
without- Specified by:
- withoutin interface- MutableShortBag
- Specified by:
- withoutin interface- MutableShortCollection
- Overrides:
- withoutin class- AbstractUnmodifiableShortCollection
 
- 
withAll- Specified by:
- withAllin interface- MutableShortBag
- Specified by:
- withAllin interface- MutableShortCollection
- Overrides:
- withAllin class- AbstractUnmodifiableShortCollection
 
- 
withoutAll- Specified by:
- withoutAllin interface- MutableShortBag
- Specified by:
- withoutAllin interface- MutableShortCollection
- Overrides:
- withoutAllin class- AbstractUnmodifiableShortCollection
 
- 
addOccurrencespublic void addOccurrences(short item, int occurrences)- Specified by:
- addOccurrencesin interface- MutableShortBag
 
- 
removeOccurrencespublic boolean removeOccurrences(short item, int occurrences)- Specified by:
- removeOccurrencesin interface- MutableShortBag
 
- 
sizeDistinctpublic int sizeDistinct()Description copied from interface:ShortBagThe size of the Bag when counting only distinct elements.- Specified by:
- sizeDistinctin interface- ShortBag
 
- 
occurrencesOfpublic int occurrencesOf(short item)Description copied from interface:ShortBagThe occurrences of a distinct item in the bag.- Specified by:
- occurrencesOfin interface- ShortBag
 
- 
forEachWithOccurrencesDescription copied from interface:ShortBagFor each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
- forEachWithOccurrencesin interface- ShortBag
 
- 
selectByOccurrencesDescription copied from interface:MutableShortBagReturns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
- selectByOccurrencesin interface- MutableShortBag
- Specified by:
- selectByOccurrencesin interface- ShortBag
 
- 
selectUniqueDescription copied from interface:MutableShortBagReturns all elements of the bag that have exactly one occurrence.- Specified by:
- selectUniquein interface- MutableShortBag
- Specified by:
- selectUniquein interface- ShortBag
 
- 
topOccurrencesDescription copied from interface:MutableShortBagReturns thecountmost 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:
- topOccurrencesin interface- MutableShortBag
- Specified by:
- topOccurrencesin interface- ShortBag
 
- 
bottomOccurrencesDescription copied from interface:MutableShortBagReturns thecountleast 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:
- bottomOccurrencesin interface- MutableShortBag
- Specified by:
- bottomOccurrencesin interface- ShortBag
 
- 
selectDescription copied from interface:ShortIterableReturns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.- Specified by:
- selectin interface- MutableShortBag
- Specified by:
- selectin interface- MutableShortCollection
- Specified by:
- selectin interface- ShortBag
- Specified by:
- selectin interface- ShortIterable
- Overrides:
- selectin class- AbstractUnmodifiableShortCollection
 
- 
rejectDescription copied from interface:ShortIterableReturns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.- Specified by:
- rejectin interface- MutableShortBag
- Specified by:
- rejectin interface- MutableShortCollection
- Specified by:
- rejectin interface- ShortBag
- Specified by:
- rejectin interface- ShortIterable
- Overrides:
- rejectin class- AbstractUnmodifiableShortCollection
 
- 
collectDescription copied from interface:ShortIterableReturns 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:
- collectin interface- MutableShortBag
- Specified by:
- collectin interface- MutableShortCollection
- Specified by:
- collectin interface- ShortBag
- Specified by:
- collectin interface- ShortIterable
- Overrides:
- collectin class- AbstractUnmodifiableShortCollection
 
- 
equalsDescription copied from interface:ShortBagFollows the same general contract asBag.equals(Object).
- 
hashCodepublic int hashCode()Description copied from interface:ShortBagFollows the same general contract asBag.hashCode().
- 
asUnmodifiable- Specified by:
- asUnmodifiablein interface- MutableShortBag
- Specified by:
- asUnmodifiablein interface- MutableShortCollection
- Overrides:
- asUnmodifiablein class- AbstractUnmodifiableShortCollection
 
- 
asSynchronized- Specified by:
- asSynchronizedin interface- MutableShortBag
- Specified by:
- asSynchronizedin interface- MutableShortCollection
- Overrides:
- asSynchronizedin class- AbstractUnmodifiableShortCollection
 
- 
toImmutableDescription copied from interface:MutableShortBagReturns an immutable copy of this bag.- Specified by:
- toImmutablein interface- MutableShortBag
- Specified by:
- toImmutablein interface- MutableShortCollection
- Specified by:
- toImmutablein interface- ShortBag
- Overrides:
- toImmutablein class- AbstractUnmodifiableShortCollection
 
- 
newEmptyDescription copied from interface:MutableShortBagCreates a new empty mutable version of the same Bag type.- Specified by:
- newEmptyin interface- MutableShortBag
- Specified by:
- newEmptyin interface- MutableShortCollection
- Since:
- 9.2.
 
 
-