Class UnmodifiableIntBag
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableIntCollection
-
- org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableIntBag
-
- All Implemented Interfaces:
java.io.Serializable,IntBag,MutableIntBag,MutableIntCollection,IntIterable,PrimitiveIterable
public class UnmodifiableIntBag extends AbstractUnmodifiableIntCollection implements MutableIntBag
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 UnmodifiableIntBag(MutableIntBag bag)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOccurrences(int item, int occurrences)MutableIntBagasSynchronized()MutableIntBagasUnmodifiable()MutableList<IntIntPair>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.booleanequals(java.lang.Object otherBag)Follows the same general contract asBag.equals(Object).voidforEachWithOccurrences(IntIntProcedure procedure)For each distinct item, with the number of occurrences, execute the specified procedure.private MutableIntBaggetMutableIntBag()inthashCode()Follows the same general contract asBag.hashCode().MutableIntBagnewEmpty()Creates a new empty mutable version of the same Bag type.intoccurrencesOf(int item)The occurrences of a distinct item in the bag.MutableIntBagreject(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)MutableIntBagselect(IntPredicate predicate)Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.MutableIntBagselectByOccurrences(IntPredicate predicate)Returns all elements of the bag that have a number of occurrences that satisfy the predicate.MutableIntSetselectUnique()Returns all elements of the bag that have exactly one occurrence.intsizeDistinct()The size of the Bag when counting only distinct elements.ImmutableIntBagtoImmutable()Returns an immutable copy of this bag.MutableList<IntIntPair>topOccurrences(int count)Returns thecountmost frequently occurring items.UnmodifiableIntBagwith(int element)UnmodifiableIntBagwithAll(IntIterable elements)UnmodifiableIntBagwithout(int element)UnmodifiableIntBagwithoutAll(IntIterable elements)-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.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, 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.IntBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.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, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableIntBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableIntCollection
add, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnmodifiableIntBag
public UnmodifiableIntBag(MutableIntBag bag)
-
-
Method Detail
-
getMutableIntBag
private MutableIntBag getMutableIntBag()
-
with
public UnmodifiableIntBag with(int element)
- Specified by:
within interfaceMutableIntBag- Specified by:
within interfaceMutableIntCollection- Overrides:
within classAbstractUnmodifiableIntCollection
-
without
public UnmodifiableIntBag without(int element)
- Specified by:
withoutin interfaceMutableIntBag- Specified by:
withoutin interfaceMutableIntCollection- Overrides:
withoutin classAbstractUnmodifiableIntCollection
-
withAll
public UnmodifiableIntBag withAll(IntIterable elements)
- Specified by:
withAllin interfaceMutableIntBag- Specified by:
withAllin interfaceMutableIntCollection- Overrides:
withAllin classAbstractUnmodifiableIntCollection
-
withoutAll
public UnmodifiableIntBag withoutAll(IntIterable elements)
- 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
public void forEachWithOccurrences(IntIntProcedure procedure)
Description copied from interface:IntBagFor each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrencesin interfaceIntBag
-
selectByOccurrences
public MutableIntBag selectByOccurrences(IntPredicate predicate)
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
public MutableIntSet 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
public MutableList<IntIntPair> topOccurrences(int count)
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
public MutableList<IntIntPair> bottomOccurrences(int count)
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
public MutableIntBag select(IntPredicate predicate)
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
public MutableIntBag reject(IntPredicate predicate)
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
public <V> MutableBag<V> collect(IntToObjectFunction<? extends V> function)
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
public boolean equals(java.lang.Object otherBag)
Description copied from interface:IntBagFollows the same general contract asBag.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:IntBagFollows the same general contract asBag.hashCode().
-
asUnmodifiable
public MutableIntBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableIntBag- Specified by:
asUnmodifiablein interfaceMutableIntCollection- Overrides:
asUnmodifiablein classAbstractUnmodifiableIntCollection
-
asSynchronized
public MutableIntBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableIntBag- Specified by:
asSynchronizedin interfaceMutableIntCollection- Overrides:
asSynchronizedin classAbstractUnmodifiableIntCollection
-
toImmutable
public ImmutableIntBag 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
public MutableIntBag newEmpty()
Description copied from interface:MutableIntBagCreates a new empty mutable version of the same Bag type.- Specified by:
newEmptyin interfaceMutableIntBag- Specified by:
newEmptyin interfaceMutableIntCollection- Since:
- 9.2.
-
-