@NotThreadSafe public final class ByteHashBag extends AbstractByteIterable 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(byte... elements) |
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,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable . |
MutableByteBag |
asSynchronized() |
MutableByteBag |
asUnmodifiable() |
MutableByteIterator |
byteIterator() |
void |
clear() |
<V> MutableBag<V> |
collect(ByteToObjectFunction<? extends V> function) |
boolean |
contains(byte value) |
int |
count(BytePredicate predicate) |
byte |
detectIfNone(BytePredicate predicate,
byte ifNone) |
void |
each(ByteProcedure procedure) |
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.
|
byte |
max() |
byte |
min() |
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() |
ImmutableByteBag |
toImmutable()
Returns an immutable copy of this bag.
|
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) |
appendString, appendString, asLazy, average, containsAll, containsAll, makeString, makeString, makeString, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList
appendString, appendString, makeString, makeString, makeString, toString
public 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()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
isEmpty
in class AbstractByteIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
notEmpty
in class AbstractByteIterable
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public int sizeDistinct()
ByteBag
sizeDistinct
in interface ByteBag
public void clear()
clear
in interface MutableByteCollection
public ByteHashBag with(byte element)
with
in interface MutableByteBag
with
in interface MutableByteCollection
public ByteHashBag with(byte element1, byte element2)
public ByteHashBag with(byte element1, byte element2, byte element3)
public ByteHashBag withAll(ByteIterable iterable)
withAll
in interface MutableByteBag
withAll
in interface MutableByteCollection
public ByteHashBag without(byte element)
without
in interface MutableByteBag
without
in interface MutableByteCollection
public ByteHashBag withoutAll(ByteIterable iterable)
withoutAll
in interface MutableByteBag
withoutAll
in interface MutableByteCollection
public boolean contains(byte value)
contains
in interface ByteIterable
public int occurrencesOf(byte item)
ByteBag
occurrencesOf
in interface ByteBag
public void forEachWithOccurrences(ByteIntProcedure procedure)
ByteBag
forEachWithOccurrences
in interface ByteBag
public boolean add(byte item)
add
in interface MutableByteCollection
public boolean remove(byte item)
remove
in interface MutableByteCollection
public boolean addAll(byte... source)
addAll
in interface MutableByteCollection
public boolean addAll(ByteIterable source)
addAll
in interface MutableByteCollection
public boolean removeAll(byte... source)
removeAll
in interface MutableByteCollection
public boolean removeAll(ByteIterable source)
removeAll
in interface MutableByteCollection
public boolean retainAll(ByteIterable source)
retainAll
in interface MutableByteCollection
Collection.retainAll(Collection)
public boolean retainAll(byte... source)
retainAll
in interface MutableByteCollection
Collection.retainAll(Collection)
public void addOccurrences(byte item, int occurrences)
addOccurrences
in interface MutableByteBag
public boolean removeOccurrences(byte item, int occurrences)
removeOccurrences
in interface MutableByteBag
public void forEach(ByteProcedure procedure)
forEach
in interface ByteIterable
public void each(ByteProcedure procedure)
each
in interface ByteIterable
public ByteHashBag select(BytePredicate predicate)
select
in interface ByteBag
select
in interface MutableByteBag
select
in interface ByteIterable
select
in interface MutableByteCollection
public ByteHashBag reject(BytePredicate predicate)
reject
in interface ByteBag
reject
in interface MutableByteBag
reject
in interface ByteIterable
reject
in interface MutableByteCollection
public <T> T injectInto(T injectedValue, ObjectByteToObjectFunction<? super T,? extends T> function)
injectInto
in interface ByteIterable
public boolean equals(Object otherBag)
ByteBag
Bag.equals(Object)
.public int hashCode()
ByteBag
Bag.hashCode()
.public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public int count(BytePredicate predicate)
count
in interface ByteIterable
public boolean anySatisfy(BytePredicate predicate)
anySatisfy
in interface ByteIterable
public boolean allSatisfy(BytePredicate predicate)
allSatisfy
in interface ByteIterable
public boolean noneSatisfy(BytePredicate predicate)
noneSatisfy
in interface ByteIterable
public byte detectIfNone(BytePredicate predicate, byte ifNone)
detectIfNone
in interface ByteIterable
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
public byte max()
max
in interface ByteIterable
public byte min()
min
in interface ByteIterable
public long sum()
sum
in interface ByteIterable
public byte[] toArray()
toArray
in interface ByteIterable
public MutableByteBag asUnmodifiable()
asUnmodifiable
in interface MutableByteBag
asUnmodifiable
in interface MutableByteCollection
public MutableByteBag asSynchronized()
asSynchronized
in interface MutableByteBag
asSynchronized
in interface MutableByteCollection
public ImmutableByteBag toImmutable()
MutableByteBag
toImmutable
in interface ByteBag
toImmutable
in interface MutableByteBag
toImmutable
in interface MutableByteCollection
public MutableByteIterator byteIterator()
byteIterator
in interface ByteIterable
byteIterator
in interface MutableByteCollection
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
Copyright © 2004–2016. All rights reserved.