java.io.Externalizable, java.io.Serializable, ByteBag, MutableByteBag, ByteIterable, MutableByteCollection, PrimitiveIterablepublic class ByteHashBag extends AbstractByteIterable implements MutableByteBag, java.io.Externalizable
HashBag, and is memory-optimized for byte primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor | Description |
|---|---|
ByteHashBag() |
|
ByteHashBag(byte... elements) |
|
ByteHashBag(int size) |
|
ByteHashBag(ByteIterable iterable) |
|
ByteHashBag(ByteHashBag bag) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(byte item) |
|
boolean |
addAll(byte... source) |
|
boolean |
addAll(ByteIterable source) |
|
void |
addOccurrences(byte item,
int occurrences) |
|
boolean |
allSatisfy(BytePredicate predicate) |
Returns true if all of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(BytePredicate predicate) |
Returns true if any of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end) |
Prints a string representation of this collection onto the given
Appendable. |
MutableByteBag |
asSynchronized() |
|
MutableByteBag |
asUnmodifiable() |
|
MutableList<ByteIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
MutableByteIterator |
byteIterator() |
Returns a primitive iterator that can be used to iterate over the ByteIterable in an
imperative style.
|
RichIterable<ByteIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<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 |
contains(byte value) |
Returns true if the value is contained in the ByteIterable, and false if it is not.
|
int |
count(BytePredicate predicate) |
Returns a count of the number of elements in the ByteIterable that return true for the
specified predicate.
|
byte |
detectIfNone(BytePredicate predicate,
byte ifNone) |
|
void |
each(ByteProcedure procedure) |
A synonym for forEach.
|
boolean |
equals(java.lang.Object otherBag) |
Follows the same general contract as
Bag.equals(Object). |
void |
forEach(ByteProcedure procedure) |
Applies the ByteProcedure to each element in the ByteIterable.
|
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(). |
<T> T |
injectInto(T injectedValue,
ObjectByteToObjectFunction<? super T,? extends T> function) |
|
boolean |
isEmpty() |
Returns true if this iterable has zero items.
|
byte |
max() |
|
byte |
min() |
|
static ByteHashBag |
newBag(int size) |
|
static ByteHashBag |
newBag(ByteBag source) |
|
static ByteHashBag |
newBag(ByteIterable source) |
|
static ByteHashBag |
newBagWith(byte... source) |
|
ByteHashBag |
newEmpty() |
Creates a new empty ByteHashBag.
|
boolean |
noneSatisfy(BytePredicate predicate) |
Returns true if none of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
notEmpty() |
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(byte item) |
The occurrences of a distinct item in the bag.
|
void |
readExternal(java.io.ObjectInput in) |
|
ByteHashBag |
reject(BytePredicate predicate) |
Returns a new ByteIterable with all of the elements in the ByteIterable that
return false for the specified predicate.
|
boolean |
remove(byte item) |
|
boolean |
removeAll(byte... source) |
|
boolean |
removeAll(ByteIterable source) |
|
boolean |
removeIf(BytePredicate predicate) |
|
boolean |
removeOccurrences(byte item,
int occurrences) |
|
boolean |
retainAll(byte... source) |
|
boolean |
retainAll(ByteIterable source) |
|
ByteHashBag |
select(BytePredicate predicate) |
Returns a new ByteIterable with all of the elements in the ByteIterable that
return true for the specified predicate.
|
ByteHashBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
MutableByteSet |
selectUnique() |
Returns all elements of the bag that have exactly one occurrence.
|
int |
size() |
Returns the number of items in this iterable.
|
int |
sizeDistinct() |
The size of the Bag when counting only distinct elements.
|
long |
sum() |
|
byte[] |
toArray() |
Converts the ByteIterable to a primitive byte array.
|
ImmutableByteBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<ByteIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
ByteHashBag |
with(byte element) |
|
ByteHashBag |
with(byte element1,
byte element2) |
|
ByteHashBag |
with(byte element1,
byte element2,
byte element3) |
|
ByteHashBag |
withAll(ByteIterable iterable) |
|
ByteHashBag |
without(byte element) |
|
ByteHashBag |
withoutAll(ByteIterable iterable) |
|
void |
writeExternal(java.io.ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringtoStringOfItemToCountasLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedListselectDuplicates, tapappendString, appendString, makeString, makeString, makeString, toStringpublic ByteHashBag()
public ByteHashBag(int size)
public ByteHashBag(ByteIterable iterable)
public ByteHashBag(byte... elements)
public ByteHashBag(ByteHashBag bag)
public static ByteHashBag newBag(int size)
public static ByteHashBag newBagWith(byte... source)
public static ByteHashBag newBag(ByteIterable source)
public static ByteHashBag newBag(ByteBag source)
public boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic int sizeDistinct()
ByteBagsizeDistinct in interface ByteBagpublic void clear()
clear in interface MutableByteCollectionpublic ByteHashBag with(byte element)
with in interface MutableByteBagwith in interface MutableByteCollectionpublic ByteHashBag with(byte element1, byte element2)
public ByteHashBag with(byte element1, byte element2, byte element3)
public ByteHashBag withAll(ByteIterable iterable)
withAll in interface MutableByteBagwithAll in interface MutableByteCollectionpublic ByteHashBag without(byte element)
without in interface MutableByteBagwithout in interface MutableByteCollectionpublic ByteHashBag withoutAll(ByteIterable iterable)
withoutAll in interface MutableByteBagwithoutAll in interface MutableByteCollectionpublic boolean contains(byte value)
ByteIterablecontains in interface ByteIterablepublic int occurrencesOf(byte item)
ByteBagoccurrencesOf in interface ByteBagpublic void forEachWithOccurrences(ByteIntProcedure procedure)
ByteBagforEachWithOccurrences in interface ByteBagpublic ByteHashBag selectByOccurrences(IntPredicate predicate)
MutableByteBagselectByOccurrences in interface ByteBagselectByOccurrences in interface MutableByteBagpublic MutableByteSet selectUnique()
MutableByteBagselectUnique in interface ByteBagselectUnique in interface MutableByteBagpublic MutableList<ByteIntPair> topOccurrences(int count)
MutableByteBagcount 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 ByteBagtopOccurrences in interface MutableByteBagpublic MutableList<ByteIntPair> bottomOccurrences(int count)
MutableByteBagcount 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 ByteBagbottomOccurrences in interface MutableByteBagpublic boolean add(byte item)
add in interface MutableByteCollectionpublic boolean remove(byte item)
remove in interface MutableByteCollectionpublic boolean removeIf(BytePredicate predicate)
removeIf in interface MutableByteCollectionpublic boolean addAll(byte... source)
addAll in interface MutableByteCollectionpublic boolean addAll(ByteIterable source)
addAll in interface MutableByteCollectionpublic boolean removeAll(byte... source)
removeAll in interface MutableByteCollectionpublic boolean removeAll(ByteIterable source)
removeAll in interface MutableByteCollectionpublic boolean retainAll(ByteIterable source)
retainAll in interface MutableByteCollectionCollection.retainAll(Collection)public boolean retainAll(byte... source)
retainAll in interface MutableByteCollectionCollection.retainAll(Collection)public void addOccurrences(byte item,
int occurrences)
addOccurrences in interface MutableByteBagpublic boolean removeOccurrences(byte item,
int occurrences)
removeOccurrences in interface MutableByteBagpublic void forEach(ByteProcedure procedure)
ByteIterableforEach in interface ByteIterablepublic void each(ByteProcedure procedure)
ByteIterableeach in interface ByteIterablepublic ByteHashBag select(BytePredicate predicate)
ByteIterableselect in interface ByteBagselect in interface ByteIterableselect in interface MutableByteBagselect in interface MutableByteCollectionpublic ByteHashBag reject(BytePredicate predicate)
ByteIterablereject in interface ByteBagreject in interface ByteIterablereject in interface MutableByteBagreject in interface MutableByteCollectionpublic <T> T injectInto(T injectedValue,
ObjectByteToObjectFunction<? super T,? extends T> function)
injectInto in interface ByteIterablepublic RichIterable<ByteIterable> chunk(int size)
ByteIterablechunk in interface ByteIterablesize - the number of elements per chunkRichIterable containing ByteIterables of size size, except the last will be
truncated if the elements don't divide evenly.public boolean equals(java.lang.Object otherBag)
ByteBagBag.equals(Object).public int hashCode()
ByteBagBag.hashCode().public void appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic int count(BytePredicate predicate)
ByteIterablecount in interface ByteIterablepublic boolean anySatisfy(BytePredicate predicate)
ByteIterableanySatisfy in interface ByteIterablepublic boolean allSatisfy(BytePredicate predicate)
ByteIterableallSatisfy in interface ByteIterablepublic boolean noneSatisfy(BytePredicate predicate)
ByteIterablenoneSatisfy in interface ByteIterablepublic byte detectIfNone(BytePredicate predicate, byte ifNone)
detectIfNone in interface ByteIterablepublic <V> MutableBag<V> collect(ByteToObjectFunction<? extends V> function)
ByteIterablecollect in interface ByteBagcollect in interface ByteIterablecollect in interface MutableByteBagcollect in interface MutableByteCollectionpublic byte max()
max in interface ByteIterablepublic byte min()
min in interface ByteIterablepublic long sum()
sum in interface ByteIterablepublic byte[] toArray()
ByteIterabletoArray in interface ByteIterablepublic MutableByteBag asUnmodifiable()
asUnmodifiable in interface MutableByteBagasUnmodifiable in interface MutableByteCollectionpublic MutableByteBag asSynchronized()
asSynchronized in interface MutableByteBagasSynchronized in interface MutableByteCollectionpublic ImmutableByteBag toImmutable()
MutableByteBagtoImmutable in interface ByteBagtoImmutable in interface MutableByteBagtoImmutable in interface MutableByteCollectionpublic ByteHashBag newEmpty()
newEmpty in interface MutableByteBagnewEmpty in interface MutableByteCollectionpublic MutableByteIterator byteIterator()
ByteIterablebyteIterator in interface ByteIterablebyteIterator in interface MutableByteCollectionpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal in interface java.io.Externalizablejava.io.IOExceptionCopyright © 2004–2020. All rights reserved.