Class UnmodifiableIntBag
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableIntCollection
org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableIntBag
- All Implemented Interfaces:
Serializable, IntBag, MutableIntBag, MutableIntCollection, IntIterable, PrimitiveIterable
This file was automatically generated from template file unmodifiablePrimitiveBag.stg.
- Since:
- 3.1.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOccurrences(int item, int occurrences) bottomOccurrences(int count) Returns thecountleast frequently occurring items.<V> MutableBag<V> collect(IntToObjectFunction<? extends V> function) Returns a new collection with the results of applying the specified function on each element of the source collection.booleanFollows the same general contract asBag.equals(Object).voidforEachWithOccurrences(IntIntProcedure procedure) For each distinct item, with the number of occurrences, execute the specified procedure.private MutableIntBaginthashCode()Follows the same general contract asBag.hashCode().newEmpty()Creates a new empty mutable version of the same collection type.intoccurrencesOf(int item) The occurrences of a distinct item in the bag.reject(IntPredicate predicate) Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.booleanremoveOccurrences(int item, int occurrences) select(IntPredicate predicate) Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.selectByOccurrences(IntPredicate predicate) Returns all elements of the bag that have a number of occurrences that satisfy the predicate.Returns all elements of the bag that have exactly one occurrence.intThe size of the Bag when counting only distinct elements.Returns an immutable copy of this bag.topOccurrences(int count) Returns thecountmost frequently occurring items.with(int element) withAll(IntIterable elements) without(int element) withoutAll(IntIterable elements) Methods inherited from class AbstractUnmodifiableIntCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getIntCollection, injectInto, intIterator, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods inherited from interface IntBag
toStringOfItemToCountMethods inherited from interface IntIterable
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, toSortedListByMethods inherited from interface MutableIntBag
selectDuplicates, tapMethods inherited from interface MutableIntCollection
add, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAllMethods inherited from interface PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
UnmodifiableIntBag
-
-
Method Details
-
getMutableIntBag
-
with
- Specified by:
within interfaceMutableIntBag- Specified by:
within interfaceMutableIntCollection- Overrides:
within classAbstractUnmodifiableIntCollection
-
without
- Specified by:
withoutin interfaceMutableIntBag- Specified by:
withoutin interfaceMutableIntCollection- Overrides:
withoutin classAbstractUnmodifiableIntCollection
-
withAll
- Specified by:
withAllin interfaceMutableIntBag- Specified by:
withAllin interfaceMutableIntCollection- Overrides:
withAllin classAbstractUnmodifiableIntCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableIntBag- Specified by:
withoutAllin interfaceMutableIntCollection- Overrides:
withoutAllin classAbstractUnmodifiableIntCollection
-
addOccurrences
public void addOccurrences(int item, int occurrences) - Specified by:
addOccurrencesin interfaceMutableIntBag
-
removeOccurrences
public boolean removeOccurrences(int item, int occurrences) - Specified by:
removeOccurrencesin interfaceMutableIntBag
-
sizeDistinct
public int sizeDistinct()Description copied from interface:IntBagThe size of the Bag when counting only distinct elements.- Specified by:
sizeDistinctin interfaceIntBag
-
occurrencesOf
public int occurrencesOf(int item) Description copied from interface:IntBagThe occurrences of a distinct item in the bag.- Specified by:
occurrencesOfin interfaceIntBag
-
forEachWithOccurrences
Description copied from interface:IntBagFor each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrencesin interfaceIntBag
-
selectByOccurrences
Description copied from interface:MutableIntBagReturns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrencesin interfaceIntBag- Specified by:
selectByOccurrencesin interfaceMutableIntBag
-
selectUnique
Description copied from interface:MutableIntBagReturns all elements of the bag that have exactly one occurrence.- Specified by:
selectUniquein interfaceIntBag- Specified by:
selectUniquein interfaceMutableIntBag
-
topOccurrences
Description copied from interface:MutableIntBagReturns 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 interfaceIntBag- Specified by:
topOccurrencesin interfaceMutableIntBag
-
bottomOccurrences
Description copied from interface:MutableIntBagReturns 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 interfaceIntBag- Specified by:
bottomOccurrencesin interfaceMutableIntBag
-
select
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.- Specified by:
selectin interfaceIntBag- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceMutableIntBag- Specified by:
selectin interfaceMutableIntCollection- Overrides:
selectin classAbstractUnmodifiableIntCollection
-
reject
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.- Specified by:
rejectin interfaceIntBag- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceMutableIntBag- Specified by:
rejectin interfaceMutableIntCollection- Overrides:
rejectin classAbstractUnmodifiableIntCollection
-
collect
Description copied from interface:IntIterableReturns 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 interfaceIntBag- Specified by:
collectin interfaceIntIterable- Specified by:
collectin interfaceMutableIntBag- Specified by:
collectin interfaceMutableIntCollection- Overrides:
collectin classAbstractUnmodifiableIntCollection
-
equals
-
hashCode
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableIntBag- Specified by:
asUnmodifiablein interfaceMutableIntCollection- Overrides:
asUnmodifiablein classAbstractUnmodifiableIntCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableIntBag- Specified by:
asSynchronizedin interfaceMutableIntCollection- Overrides:
asSynchronizedin classAbstractUnmodifiableIntCollection
-
toImmutable
Description copied from interface:MutableIntBagReturns an immutable copy of this bag.- Specified by:
toImmutablein interfaceIntBag- Specified by:
toImmutablein interfaceMutableIntBag- Specified by:
toImmutablein interfaceMutableIntCollection- Overrides:
toImmutablein classAbstractUnmodifiableIntCollection
-
newEmpty
Description copied from interface:MutableIntCollectionCreates a new empty mutable version of the same collection type.- Specified by:
newEmptyin interfaceMutableIntBag- Specified by:
newEmptyin interfaceMutableIntCollection- Since:
- 9.2.
-