@NotThreadSafe public final class ByteHashBag extends Object implements MutableByteBag, Externalizable
HashBag, and is memory-optimized for byte primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor and Description |
|---|
ByteHashBag() |
ByteHashBag(ByteHashBag bag) |
ByteHashBag(ByteIterable iterable) |
ByteHashBag(int size) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(byte item) |
boolean |
addAll(byte... source) |
boolean |
addAll(ByteIterable source) |
void |
addOccurrences(byte item,
int occurrences) |
boolean |
allSatisfy(BytePredicate predicate) |
boolean |
anySatisfy(BytePredicate predicate) |
void |
appendString(Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
LazyByteIterable |
asLazy() |
MutableByteBag |
asSynchronized() |
MutableByteBag |
asUnmodifiable() |
double |
average() |
ByteIterator |
byteIterator() |
void |
clear() |
<V> MutableBag<V> |
collect(ByteToObjectFunction<? extends V> function) |
boolean |
contains(byte value) |
boolean |
containsAll(byte... source) |
boolean |
containsAll(ByteIterable source) |
int |
count(BytePredicate predicate) |
byte |
detectIfNone(BytePredicate predicate,
byte ifNone) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object). |
void |
forEach(ByteProcedure procedure) |
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.
|
String |
makeString()
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator)
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end)
Returns a string representation of this collection.
|
byte |
max() |
byte |
maxIfEmpty(byte defaultValue) |
double |
median() |
byte |
min() |
byte |
minIfEmpty(byte defaultValue) |
static ByteHashBag |
newBag(ByteBag source) |
static ByteHashBag |
newBag(ByteIterable source) |
static ByteHashBag |
newBag(int size) |
static ByteHashBag |
newBagWith(byte... source) |
boolean |
noneSatisfy(BytePredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(byte item)
The occurrences of a distinct item in the bag.
|
void |
readExternal(ObjectInput in) |
ByteHashBag |
reject(BytePredicate predicate) |
boolean |
remove(byte item) |
boolean |
removeAll(byte... source) |
boolean |
removeAll(ByteIterable source) |
boolean |
removeOccurrences(byte item,
int occurrences) |
boolean |
retainAll(byte... source) |
boolean |
retainAll(ByteIterable source) |
ByteHashBag |
select(BytePredicate predicate) |
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() |
MutableByteBag |
toBag() |
ImmutableByteBag |
toImmutable()
Returns an immutable copy of this bag.
|
MutableByteList |
toList() |
MutableByteSet |
toSet() |
byte[] |
toSortedArray() |
MutableByteList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
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(ObjectOutput out) |
public ByteHashBag()
public ByteHashBag(int size)
public ByteHashBag(ByteIterable iterable)
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)
contains in interface ByteIterablepublic boolean containsAll(byte... source)
containsAll in interface ByteIterablepublic boolean containsAll(ByteIterable source)
containsAll in interface ByteIterablepublic int occurrencesOf(byte item)
ByteBagoccurrencesOf in interface ByteBagpublic void forEachWithOccurrences(ByteIntProcedure procedure)
ByteBagforEachWithOccurrences in interface ByteBagpublic boolean add(byte item)
add in interface MutableByteCollectionpublic boolean remove(byte item)
remove 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)
forEach in interface ByteIterablepublic ByteHashBag select(BytePredicate predicate)
select in interface ByteBagselect in interface MutableByteBagselect in interface ByteIterableselect in interface MutableByteCollectionpublic ByteHashBag reject(BytePredicate predicate)
reject in interface ByteBagreject in interface MutableByteBagreject in interface ByteIterablereject in interface MutableByteCollectionpublic <T> T injectInto(T injectedValue,
ObjectByteToObjectFunction<? super T,? extends T> function)
injectInto in interface ByteIterablepublic boolean equals(Object otherBag)
ByteBagBag.equals(Object).public int hashCode()
ByteBagBag.hashCode().public String toString()
PrimitiveIterabletoString in interface PrimitiveIterabletoString in class Objectpublic String makeString()
PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface PrimitiveIterablepublic String makeString(String separator)
PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
PrimitiveIterablemakeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic int count(BytePredicate predicate)
count in interface ByteIterablepublic boolean anySatisfy(BytePredicate predicate)
anySatisfy in interface ByteIterablepublic boolean allSatisfy(BytePredicate predicate)
allSatisfy in interface ByteIterablepublic boolean noneSatisfy(BytePredicate predicate)
noneSatisfy in interface ByteIterablepublic byte detectIfNone(BytePredicate predicate, byte ifNone)
detectIfNone in interface ByteIterablepublic <V> MutableBag<V> collect(ByteToObjectFunction<? extends V> function)
collect in interface ByteBagcollect in interface MutableByteBagcollect in interface ByteIterablecollect in interface MutableByteCollectionpublic byte max()
max in interface ByteIterablepublic byte min()
min in interface ByteIterablepublic long sum()
sum in interface ByteIterablepublic byte minIfEmpty(byte defaultValue)
minIfEmpty in interface ByteIterablepublic byte maxIfEmpty(byte defaultValue)
maxIfEmpty in interface ByteIterablepublic double average()
average in interface ByteIterablepublic double median()
median in interface ByteIterablepublic byte[] toArray()
toArray in interface ByteIterablepublic byte[] toSortedArray()
toSortedArray in interface ByteIterablepublic MutableByteList toList()
toList in interface ByteIterablepublic MutableByteList toSortedList()
toSortedList in interface ByteIterablepublic MutableByteSet toSet()
toSet in interface ByteIterablepublic MutableByteBag toBag()
toBag in interface ByteIterablepublic LazyByteIterable asLazy()
asLazy 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 ByteIterator byteIterator()
byteIterator in interface ByteIterablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2004–2017. All rights reserved.