Class UnmodifiableShortBag
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableShortCollection
-
- org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableShortBag
-
- All Implemented Interfaces:
java.io.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
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description UnmodifiableShortBag(MutableShortBag bag)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier 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(java.lang.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.private MutableShortBaggetMutableShortBag()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.AbstractUnmodifiableShortCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getShortCollection, 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, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableShortBag
selectDuplicates, tap
-
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
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, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnmodifiableShortBag
public UnmodifiableShortBag(MutableShortBag bag)
-
-
Method Detail
-
getMutableShortBag
private MutableShortBag getMutableShortBag()
-
with
public UnmodifiableShortBag with(short element)
- Specified by:
within interfaceMutableShortBag- Specified by:
within interfaceMutableShortCollection- Overrides:
within classAbstractUnmodifiableShortCollection
-
without
public UnmodifiableShortBag without(short element)
- Specified by:
withoutin interfaceMutableShortBag- Specified by:
withoutin interfaceMutableShortCollection- Overrides:
withoutin classAbstractUnmodifiableShortCollection
-
withAll
public UnmodifiableShortBag withAll(ShortIterable elements)
- Specified by:
withAllin interfaceMutableShortBag- Specified by:
withAllin interfaceMutableShortCollection- Overrides:
withAllin classAbstractUnmodifiableShortCollection
-
withoutAll
public UnmodifiableShortBag withoutAll(ShortIterable elements)
- Specified by:
withoutAllin interfaceMutableShortBag- Specified by:
withoutAllin interfaceMutableShortCollection- Overrides:
withoutAllin classAbstractUnmodifiableShortCollection
-
addOccurrences
public void addOccurrences(short item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableShortBag
-
removeOccurrences
public boolean removeOccurrences(short item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableShortBag
-
sizeDistinct
public int sizeDistinct()
Description copied from interface:ShortBagThe size of the Bag when counting only distinct elements.- Specified by:
sizeDistinctin interfaceShortBag
-
occurrencesOf
public int occurrencesOf(short item)
Description copied from interface:ShortBagThe occurrences of a distinct item in the bag.- Specified by:
occurrencesOfin interfaceShortBag
-
forEachWithOccurrences
public void forEachWithOccurrences(ShortIntProcedure procedure)
Description copied from interface:ShortBagFor each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrencesin interfaceShortBag
-
selectByOccurrences
public MutableShortBag selectByOccurrences(IntPredicate predicate)
Description copied from interface:MutableShortBagReturns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrencesin interfaceMutableShortBag- Specified by:
selectByOccurrencesin interfaceShortBag
-
selectUnique
public MutableShortSet selectUnique()
Description copied from interface:MutableShortBagReturns all elements of the bag that have exactly one occurrence.- Specified by:
selectUniquein interfaceMutableShortBag- Specified by:
selectUniquein interfaceShortBag
-
topOccurrences
public MutableList<ShortIntPair> topOccurrences(int count)
Description 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 interfaceMutableShortBag- Specified by:
topOccurrencesin interfaceShortBag
-
bottomOccurrences
public MutableList<ShortIntPair> bottomOccurrences(int count)
Description 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 interfaceMutableShortBag- Specified by:
bottomOccurrencesin interfaceShortBag
-
select
public MutableShortBag select(ShortPredicate predicate)
Description 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 interfaceMutableShortBag- Specified by:
selectin interfaceMutableShortCollection- Specified by:
selectin interfaceShortBag- Specified by:
selectin interfaceShortIterable- Overrides:
selectin classAbstractUnmodifiableShortCollection
-
reject
public MutableShortBag reject(ShortPredicate predicate)
Description 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 interfaceMutableShortBag- Specified by:
rejectin interfaceMutableShortCollection- Specified by:
rejectin interfaceShortBag- Specified by:
rejectin interfaceShortIterable- Overrides:
rejectin classAbstractUnmodifiableShortCollection
-
collect
public <V> MutableBag<V> collect(ShortToObjectFunction<? extends V> function)
Description 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 interfaceMutableShortBag- Specified by:
collectin interfaceMutableShortCollection- Specified by:
collectin interfaceShortBag- Specified by:
collectin interfaceShortIterable- Overrides:
collectin classAbstractUnmodifiableShortCollection
-
equals
public boolean equals(java.lang.Object otherBag)
Description copied from interface:ShortBagFollows the same general contract asBag.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:ShortBagFollows the same general contract asBag.hashCode().
-
asUnmodifiable
public MutableShortBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableShortBag- Specified by:
asUnmodifiablein interfaceMutableShortCollection- Overrides:
asUnmodifiablein classAbstractUnmodifiableShortCollection
-
asSynchronized
public MutableShortBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableShortBag- Specified by:
asSynchronizedin interfaceMutableShortCollection- Overrides:
asSynchronizedin classAbstractUnmodifiableShortCollection
-
toImmutable
public ImmutableShortBag toImmutable()
Description copied from interface:MutableShortBagReturns an immutable copy of this bag.- Specified by:
toImmutablein interfaceMutableShortBag- Specified by:
toImmutablein interfaceMutableShortCollection- Specified by:
toImmutablein interfaceShortBag- Overrides:
toImmutablein classAbstractUnmodifiableShortCollection
-
newEmpty
public MutableShortBag newEmpty()
Description copied from interface:MutableShortBagCreates a new empty mutable version of the same Bag type.- Specified by:
newEmptyin interfaceMutableShortBag- Specified by:
newEmptyin interfaceMutableShortCollection- Since:
- 9.2.
-
-