@NotThreadSafe public final class UnmodifiableByteBag extends AbstractUnmodifiableByteCollection implements MutableByteBag
Modifier and Type | Method and Description |
---|---|
void |
addOccurrences(byte item,
int occurrences) |
MutableByteBag |
asSynchronized() |
MutableByteBag |
asUnmodifiable() |
MutableList<ByteIntPair> |
bottomOccurrences(int count)
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(ByteToObjectFunction<? extends V> function) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object) . |
void |
forEachWithOccurrences(ByteIntProcedure 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(byte item)
The occurrences of a distinct item in the bag.
|
MutableByteBag |
reject(BytePredicate predicate) |
boolean |
removeOccurrences(byte item,
int occurrences) |
MutableByteBag |
select(BytePredicate predicate) |
MutableByteBag |
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.
|
ImmutableByteBag |
toImmutable()
Returns an immutable copy of this bag.
|
MutableList<ByteIntPair> |
topOccurrences(int count)
Returns the
count most frequently occurring items. |
UnmodifiableByteBag |
with(byte element) |
UnmodifiableByteBag |
withAll(ByteIterable elements) |
UnmodifiableByteBag |
without(byte element) |
UnmodifiableByteBag |
withoutAll(ByteIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, byteIterator, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, remove, removeAll, removeAll, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
add, addAll, addAll, byteIterator, clear, remove, removeAll, removeAll, retainAll, retainAll
allSatisfy, anySatisfy, asLazy, average, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public UnmodifiableByteBag with(byte element)
with
in interface MutableByteBag
with
in interface MutableByteCollection
with
in class AbstractUnmodifiableByteCollection
public UnmodifiableByteBag without(byte element)
without
in interface MutableByteBag
without
in interface MutableByteCollection
without
in class AbstractUnmodifiableByteCollection
public UnmodifiableByteBag withAll(ByteIterable elements)
withAll
in interface MutableByteBag
withAll
in interface MutableByteCollection
withAll
in class AbstractUnmodifiableByteCollection
public UnmodifiableByteBag withoutAll(ByteIterable elements)
withoutAll
in interface MutableByteBag
withoutAll
in interface MutableByteCollection
withoutAll
in class AbstractUnmodifiableByteCollection
public void addOccurrences(byte item, int occurrences)
addOccurrences
in interface MutableByteBag
public boolean removeOccurrences(byte item, int occurrences)
removeOccurrences
in interface MutableByteBag
public int sizeDistinct()
ByteBag
sizeDistinct
in interface ByteBag
public int occurrencesOf(byte item)
ByteBag
occurrencesOf
in interface ByteBag
public void forEachWithOccurrences(ByteIntProcedure procedure)
ByteBag
forEachWithOccurrences
in interface ByteBag
public MutableByteBag selectByOccurrences(IntPredicate predicate)
MutableByteBag
selectByOccurrences
in interface ByteBag
selectByOccurrences
in interface MutableByteBag
public MutableList<ByteIntPair> topOccurrences(int count)
MutableByteBag
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 ByteBag
topOccurrences
in interface MutableByteBag
public MutableList<ByteIntPair> bottomOccurrences(int count)
MutableByteBag
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 ByteBag
bottomOccurrences
in interface MutableByteBag
public MutableByteBag select(BytePredicate predicate)
select
in interface ByteBag
select
in interface MutableByteBag
select
in interface ByteIterable
select
in interface MutableByteCollection
select
in class AbstractUnmodifiableByteCollection
public MutableByteBag reject(BytePredicate predicate)
reject
in interface ByteBag
reject
in interface MutableByteBag
reject
in interface ByteIterable
reject
in interface MutableByteCollection
reject
in class AbstractUnmodifiableByteCollection
public <V> MutableBag<V> collect(ByteToObjectFunction<? extends V> function)
collect
in interface ByteBag
collect
in interface MutableByteBag
collect
in interface ByteIterable
collect
in interface MutableByteCollection
collect
in class AbstractUnmodifiableByteCollection
public boolean equals(Object otherBag)
ByteBag
Bag.equals(Object)
.public int hashCode()
ByteBag
Bag.hashCode()
.public MutableByteBag asUnmodifiable()
asUnmodifiable
in interface MutableByteBag
asUnmodifiable
in interface MutableByteCollection
asUnmodifiable
in class AbstractUnmodifiableByteCollection
public MutableByteBag asSynchronized()
asSynchronized
in interface MutableByteBag
asSynchronized
in interface MutableByteCollection
asSynchronized
in class AbstractUnmodifiableByteCollection
public ImmutableByteBag toImmutable()
MutableByteBag
toImmutable
in interface ByteBag
toImmutable
in interface MutableByteBag
toImmutable
in interface MutableByteCollection
toImmutable
in class AbstractUnmodifiableByteCollection
Copyright © 2004–2016. All rights reserved.