Class ByteHashBag
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractByteIterable
-
- org.eclipse.collections.impl.bag.mutable.primitive.ByteHashBag
-
- All Implemented Interfaces:
Externalizable,Serializable,ByteBag,MutableByteBag,ByteIterable,MutableByteCollection,PrimitiveIterable
public class ByteHashBag extends AbstractByteIterable implements MutableByteBag, Externalizable
ByteHashBag is similar toHashBag, and is memory-optimized for byte primitives. This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ByteHashBag()ByteHashBag(byte... elements)ByteHashBag(int size)ByteHashBag(ByteIterable iterable)ByteHashBag(ByteHashBag bag)
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractByteIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.ByteBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.ByteIterable
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableByteBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Constructor Detail
-
ByteHashBag
public ByteHashBag()
-
ByteHashBag
public ByteHashBag(int size)
-
ByteHashBag
public ByteHashBag(ByteIterable iterable)
-
ByteHashBag
public ByteHashBag(byte... elements)
-
ByteHashBag
public ByteHashBag(ByteHashBag bag)
-
-
Method Detail
-
newBag
public static ByteHashBag newBag(int size)
-
newBagWith
public static ByteHashBag newBagWith(byte... source)
-
newBag
public static ByteHashBag newBag(ByteIterable source)
-
newBag
public static ByteHashBag newBag(ByteBag source)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmptyin interfacePrimitiveIterable
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinctin interfaceByteBag
-
clear
public void clear()
- Specified by:
clearin interfaceMutableByteCollection
-
with
public ByteHashBag with(byte element)
- Specified by:
within interfaceMutableByteBag- Specified by:
within interfaceMutableByteCollection
-
with
public ByteHashBag with(byte element1, byte element2)
-
with
public ByteHashBag with(byte element1, byte element2, byte element3)
-
withAll
public ByteHashBag withAll(ByteIterable iterable)
- Specified by:
withAllin interfaceMutableByteBag- Specified by:
withAllin interfaceMutableByteCollection
-
without
public ByteHashBag without(byte element)
- Specified by:
withoutin interfaceMutableByteBag- Specified by:
withoutin interfaceMutableByteCollection
-
withoutAll
public ByteHashBag withoutAll(ByteIterable iterable)
- Specified by:
withoutAllin interfaceMutableByteBag- Specified by:
withoutAllin interfaceMutableByteCollection
-
contains
public boolean contains(byte value)
- Specified by:
containsin interfaceByteIterable
-
occurrencesOf
public int occurrencesOf(byte item)
- Specified by:
occurrencesOfin interfaceByteBag
-
forEachWithOccurrences
public void forEachWithOccurrences(ByteIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceByteBag
-
selectByOccurrences
public ByteHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceByteBag- Specified by:
selectByOccurrencesin interfaceMutableByteBag
-
selectUnique
public MutableByteSet selectUnique()
- Specified by:
selectUniquein interfaceByteBag- Specified by:
selectUniquein interfaceMutableByteBag
-
topOccurrences
public MutableList<ByteIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceByteBag- Specified by:
topOccurrencesin interfaceMutableByteBag
-
bottomOccurrences
public MutableList<ByteIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrencesin interfaceByteBag- Specified by:
bottomOccurrencesin interfaceMutableByteBag
-
add
public boolean add(byte item)
- Specified by:
addin interfaceMutableByteCollection
-
remove
public boolean remove(byte item)
- Specified by:
removein interfaceMutableByteCollection
-
removeIf
public boolean removeIf(BytePredicate predicate)
- Specified by:
removeIfin interfaceMutableByteCollection
-
addAll
public boolean addAll(byte... source)
- Specified by:
addAllin interfaceMutableByteCollection
-
addAll
public boolean addAll(ByteIterable source)
- Specified by:
addAllin interfaceMutableByteCollection
-
removeAll
public boolean removeAll(byte... source)
- Specified by:
removeAllin interfaceMutableByteCollection
-
removeAll
public boolean removeAll(ByteIterable source)
- Specified by:
removeAllin interfaceMutableByteCollection
-
retainAll
public boolean retainAll(ByteIterable source)
- Specified by:
retainAllin interfaceMutableByteCollection
-
retainAll
public boolean retainAll(byte... source)
- Specified by:
retainAllin interfaceMutableByteCollection
-
addOccurrences
public void addOccurrences(byte item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableByteBag
-
removeOccurrences
public boolean removeOccurrences(byte item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableByteBag
-
each
public void each(ByteProcedure procedure)
- Specified by:
eachin interfaceByteIterable- Since:
- 7.0.
-
select
public ByteHashBag select(BytePredicate predicate)
- Specified by:
selectin interfaceByteBag- Specified by:
selectin interfaceByteIterable- Specified by:
selectin interfaceMutableByteBag- Specified by:
selectin interfaceMutableByteCollection
-
reject
public ByteHashBag reject(BytePredicate predicate)
- Specified by:
rejectin interfaceByteBag- Specified by:
rejectin interfaceByteIterable- Specified by:
rejectin interfaceMutableByteBag- Specified by:
rejectin interfaceMutableByteCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectByteToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceByteIterable
-
chunk
public RichIterable<ByteIterable> chunk(int size)
- Specified by:
chunkin interfaceByteIterable
-
equals
public boolean equals(Object otherBag)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
count
public int count(BytePredicate predicate)
- Specified by:
countin interfaceByteIterable
-
anySatisfy
public boolean anySatisfy(BytePredicate predicate)
- Specified by:
anySatisfyin interfaceByteIterable
-
allSatisfy
public boolean allSatisfy(BytePredicate predicate)
- Specified by:
allSatisfyin interfaceByteIterable
-
noneSatisfy
public boolean noneSatisfy(BytePredicate predicate)
- Specified by:
noneSatisfyin interfaceByteIterable
-
detectIfNone
public byte detectIfNone(BytePredicate predicate, byte ifNone)
- Specified by:
detectIfNonein interfaceByteIterable
-
collect
public <V> MutableBag<V> collect(ByteToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceByteBag- Specified by:
collectin interfaceByteIterable- Specified by:
collectin interfaceMutableByteBag- Specified by:
collectin interfaceMutableByteCollection
-
max
public byte max()
- Specified by:
maxin interfaceByteIterable
-
min
public byte min()
- Specified by:
minin interfaceByteIterable
-
sum
public long sum()
- Specified by:
sumin interfaceByteIterable
-
toArray
public byte[] toArray()
- Specified by:
toArrayin interfaceByteIterable
-
toArray
public byte[] toArray(byte[] array)
- Specified by:
toArrayin interfaceByteIterable
-
asUnmodifiable
public MutableByteBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableByteBag- Specified by:
asUnmodifiablein interfaceMutableByteCollection
-
asSynchronized
public MutableByteBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableByteBag- Specified by:
asSynchronizedin interfaceMutableByteCollection
-
toImmutable
public ImmutableByteBag toImmutable()
- Specified by:
toImmutablein interfaceByteBag- Specified by:
toImmutablein interfaceMutableByteBag- Specified by:
toImmutablein interfaceMutableByteCollection
-
newEmpty
public ByteHashBag newEmpty()
Creates a new empty ByteHashBag.- Specified by:
newEmptyin interfaceMutableByteBag- Specified by:
newEmptyin interfaceMutableByteCollection- Since:
- 9.2.
-
byteIterator
public MutableByteIterator byteIterator()
- Specified by:
byteIteratorin interfaceByteIterable- Specified by:
byteIteratorin interfaceMutableByteCollection
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
-