ByteBag
, MutableByteBag
, ByteIterable
, MutableByteCollection
, PrimitiveIterable
public final class UnmodifiableByteBag extends AbstractUnmodifiableByteCollection implements MutableByteBag
Constructor | Description |
---|---|
UnmodifiableByteBag(MutableByteBag bag) |
Modifier and Type | Method | 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) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
boolean |
equals(java.lang.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) |
Returns a new ByteIterable with all of the elements in the ByteIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(byte item,
int occurrences) |
|
MutableByteBag |
select(BytePredicate predicate) |
Returns a new ByteIterable with all of the elements in the ByteIterable that
return true for the specified 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
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, 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, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
tap
add, addAll, addAll, byteIterator, clear, remove, removeAll, removeAll, retainAll, retainAll
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public UnmodifiableByteBag(MutableByteBag bag)
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)
ByteIterable
select
in interface ByteBag
select
in interface ByteIterable
select
in interface MutableByteBag
select
in interface MutableByteCollection
select
in class AbstractUnmodifiableByteCollection
public MutableByteBag reject(BytePredicate predicate)
ByteIterable
reject
in interface ByteBag
reject
in interface ByteIterable
reject
in interface MutableByteBag
reject
in interface MutableByteCollection
reject
in class AbstractUnmodifiableByteCollection
public <V> MutableBag<V> collect(ByteToObjectFunction<? extends V> function)
ByteIterable
collect
in interface ByteBag
collect
in interface ByteIterable
collect
in interface MutableByteBag
collect
in interface MutableByteCollection
collect
in class AbstractUnmodifiableByteCollection
public boolean equals(java.lang.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–2017. All rights reserved.