Serializable
, LongBag
, MutableLongBag
, MutableLongCollection
, LongIterable
, PrimitiveIterable
@NotThreadSafe public final class UnmodifiableLongBag extends AbstractUnmodifiableLongCollection implements MutableLongBag
Constructor | Description |
---|---|
UnmodifiableLongBag(MutableLongBag bag) |
Modifier and Type | Method | Description |
---|---|---|
void |
addOccurrences(long item,
int occurrences) |
|
MutableLongBag |
asSynchronized() |
|
MutableLongBag |
asUnmodifiable() |
|
MutableList<LongIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(LongToObjectFunction<? 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(LongIntProcedure procedure) |
For each distinct item, with the number of occurrences, execute the specified procedure.
|
int |
hashCode() |
Follows the same general contract as
Bag.hashCode() . |
int |
occurrencesOf(long item) |
The occurrences of a distinct item in the bag.
|
MutableLongBag |
reject(LongPredicate predicate) |
Returns a new LongIterable with all of the elements in the LongIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(long item,
int occurrences) |
|
MutableLongBag |
select(LongPredicate predicate) |
Returns a new LongIterable with all of the elements in the LongIterable that
return true for the specified predicate.
|
MutableLongBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
int |
sizeDistinct() |
The size of the Bag when counting only distinct elements.
|
ImmutableLongBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<LongIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
UnmodifiableLongBag |
with(long element) |
|
UnmodifiableLongBag |
withAll(LongIterable elements) |
|
UnmodifiableLongBag |
without(long element) |
|
UnmodifiableLongBag |
withoutAll(LongIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, longIterator, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, remove, removeAll, removeAll, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
allSatisfy, anySatisfy, asLazy, average, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
add, addAll, addAll, clear, longIterator, remove, removeAll, removeAll, retainAll, retainAll
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public UnmodifiableLongBag(MutableLongBag bag)
public UnmodifiableLongBag with(long element)
with
in interface MutableLongBag
with
in interface MutableLongCollection
with
in class AbstractUnmodifiableLongCollection
public UnmodifiableLongBag without(long element)
without
in interface MutableLongBag
without
in interface MutableLongCollection
without
in class AbstractUnmodifiableLongCollection
public UnmodifiableLongBag withAll(LongIterable elements)
withAll
in interface MutableLongBag
withAll
in interface MutableLongCollection
withAll
in class AbstractUnmodifiableLongCollection
public UnmodifiableLongBag withoutAll(LongIterable elements)
withoutAll
in interface MutableLongBag
withoutAll
in interface MutableLongCollection
withoutAll
in class AbstractUnmodifiableLongCollection
public void addOccurrences(long item, int occurrences)
addOccurrences
in interface MutableLongBag
public boolean removeOccurrences(long item, int occurrences)
removeOccurrences
in interface MutableLongBag
public int sizeDistinct()
LongBag
sizeDistinct
in interface LongBag
public int occurrencesOf(long item)
LongBag
occurrencesOf
in interface LongBag
public void forEachWithOccurrences(LongIntProcedure procedure)
LongBag
forEachWithOccurrences
in interface LongBag
public MutableLongBag selectByOccurrences(IntPredicate predicate)
MutableLongBag
selectByOccurrences
in interface LongBag
selectByOccurrences
in interface MutableLongBag
public MutableList<LongIntPair> topOccurrences(int count)
MutableLongBag
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 LongBag
topOccurrences
in interface MutableLongBag
public MutableList<LongIntPair> bottomOccurrences(int count)
MutableLongBag
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 LongBag
bottomOccurrences
in interface MutableLongBag
public MutableLongBag select(LongPredicate predicate)
LongIterable
select
in interface LongBag
select
in interface LongIterable
select
in interface MutableLongBag
select
in interface MutableLongCollection
select
in class AbstractUnmodifiableLongCollection
public MutableLongBag reject(LongPredicate predicate)
LongIterable
reject
in interface LongBag
reject
in interface LongIterable
reject
in interface MutableLongBag
reject
in interface MutableLongCollection
reject
in class AbstractUnmodifiableLongCollection
public <V> MutableBag<V> collect(LongToObjectFunction<? extends V> function)
LongIterable
collect
in interface LongBag
collect
in interface LongIterable
collect
in interface MutableLongBag
collect
in interface MutableLongCollection
collect
in class AbstractUnmodifiableLongCollection
public boolean equals(Object otherBag)
LongBag
Bag.equals(Object)
.public int hashCode()
LongBag
Bag.hashCode()
.public MutableLongBag asUnmodifiable()
asUnmodifiable
in interface MutableLongBag
asUnmodifiable
in interface MutableLongCollection
asUnmodifiable
in class AbstractUnmodifiableLongCollection
public MutableLongBag asSynchronized()
asSynchronized
in interface MutableLongBag
asSynchronized
in interface MutableLongCollection
asSynchronized
in class AbstractUnmodifiableLongCollection
public ImmutableLongBag toImmutable()
MutableLongBag
toImmutable
in interface LongBag
toImmutable
in interface MutableLongBag
toImmutable
in interface MutableLongCollection
toImmutable
in class AbstractUnmodifiableLongCollection
Copyright © 2004–2017. All rights reserved.