Serializable
, IntBag
, MutableIntBag
, MutableIntCollection
, IntIterable
, PrimitiveIterable
public class UnmodifiableIntBag extends AbstractUnmodifiableIntCollection implements MutableIntBag
Constructor | Description |
---|---|
UnmodifiableIntBag(MutableIntBag bag) |
Modifier and Type | Method | Description |
---|---|---|
void |
addOccurrences(int item,
int occurrences) |
|
MutableIntBag |
asSynchronized() |
|
MutableIntBag |
asUnmodifiable() |
|
MutableList<IntIntPair> |
bottomOccurrences(int count) |
Returns the
count least 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.
|
boolean |
equals(Object otherBag) |
Follows the same general contract as
Bag.equals(Object) . |
void |
forEachWithOccurrences(IntIntProcedure procedure) |
For each distinct item, with the number of occurrences, execute the specified procedure.
|
int |
hashCode() |
Follows the same general contract as
Bag.hashCode() . |
MutableIntBag |
newEmpty() |
Creates a new empty mutable version of the same Bag type.
|
int |
occurrencesOf(int item) |
The occurrences of a distinct item in the bag.
|
MutableIntBag |
reject(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(int item,
int occurrences) |
|
MutableIntBag |
select(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return true for the specified predicate.
|
MutableIntBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
MutableIntSet |
selectUnique() |
Returns all elements of the bag that have exactly one occurrence.
|
int |
sizeDistinct() |
The size of the Bag when counting only distinct elements.
|
ImmutableIntBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<IntIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
UnmodifiableIntBag |
with(int element) |
|
UnmodifiableIntBag |
withAll(IntIterable elements) |
|
UnmodifiableIntBag |
without(int element) |
|
UnmodifiableIntBag |
withoutAll(IntIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, intIterator, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
toStringOfItemToCount
allSatisfy, 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, toBag, toList, toSet, toSortedArray, toSortedList
selectDuplicates, tap
add, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public UnmodifiableIntBag(MutableIntBag bag)
public UnmodifiableIntBag with(int element)
with
in interface MutableIntBag
with
in interface MutableIntCollection
with
in class AbstractUnmodifiableIntCollection
public UnmodifiableIntBag without(int element)
without
in interface MutableIntBag
without
in interface MutableIntCollection
without
in class AbstractUnmodifiableIntCollection
public UnmodifiableIntBag withAll(IntIterable elements)
withAll
in interface MutableIntBag
withAll
in interface MutableIntCollection
withAll
in class AbstractUnmodifiableIntCollection
public UnmodifiableIntBag withoutAll(IntIterable elements)
withoutAll
in interface MutableIntBag
withoutAll
in interface MutableIntCollection
withoutAll
in class AbstractUnmodifiableIntCollection
public void addOccurrences(int item, int occurrences)
addOccurrences
in interface MutableIntBag
public boolean removeOccurrences(int item, int occurrences)
removeOccurrences
in interface MutableIntBag
public int sizeDistinct()
IntBag
sizeDistinct
in interface IntBag
public int occurrencesOf(int item)
IntBag
occurrencesOf
in interface IntBag
public void forEachWithOccurrences(IntIntProcedure procedure)
IntBag
forEachWithOccurrences
in interface IntBag
public MutableIntBag selectByOccurrences(IntPredicate predicate)
MutableIntBag
selectByOccurrences
in interface IntBag
selectByOccurrences
in interface MutableIntBag
public MutableIntSet selectUnique()
MutableIntBag
selectUnique
in interface IntBag
selectUnique
in interface MutableIntBag
public MutableList<IntIntPair> topOccurrences(int count)
MutableIntBag
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.topOccurrences
in interface IntBag
topOccurrences
in interface MutableIntBag
public MutableList<IntIntPair> bottomOccurrences(int count)
MutableIntBag
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.bottomOccurrences
in interface IntBag
bottomOccurrences
in interface MutableIntBag
public MutableIntBag select(IntPredicate predicate)
IntIterable
select
in interface IntBag
select
in interface IntIterable
select
in interface MutableIntBag
select
in interface MutableIntCollection
select
in class AbstractUnmodifiableIntCollection
public MutableIntBag reject(IntPredicate predicate)
IntIterable
reject
in interface IntBag
reject
in interface IntIterable
reject
in interface MutableIntBag
reject
in interface MutableIntCollection
reject
in class AbstractUnmodifiableIntCollection
public <V> MutableBag<V> collect(IntToObjectFunction<? extends V> function)
IntIterable
collect
in interface IntBag
collect
in interface IntIterable
collect
in interface MutableIntBag
collect
in interface MutableIntCollection
collect
in class AbstractUnmodifiableIntCollection
public boolean equals(Object otherBag)
IntBag
Bag.equals(Object)
.public int hashCode()
IntBag
Bag.hashCode()
.public MutableIntBag asUnmodifiable()
asUnmodifiable
in interface MutableIntBag
asUnmodifiable
in interface MutableIntCollection
asUnmodifiable
in class AbstractUnmodifiableIntCollection
public MutableIntBag asSynchronized()
asSynchronized
in interface MutableIntBag
asSynchronized
in interface MutableIntCollection
asSynchronized
in class AbstractUnmodifiableIntCollection
public ImmutableIntBag toImmutable()
MutableIntBag
toImmutable
in interface IntBag
toImmutable
in interface MutableIntBag
toImmutable
in interface MutableIntCollection
toImmutable
in class AbstractUnmodifiableIntCollection
public MutableIntBag newEmpty()
MutableIntBag
newEmpty
in interface MutableIntBag
newEmpty
in interface MutableIntCollection
Copyright © 2004–2019. All rights reserved.