Class ShortHashBag
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractShortIterable
-
- org.eclipse.collections.impl.bag.mutable.primitive.ShortHashBag
-
- All Implemented Interfaces:
Externalizable,Serializable,MutableShortBag,ShortBag,MutableShortCollection,PrimitiveIterable,ShortIterable
public class ShortHashBag extends AbstractShortIterable implements MutableShortBag, Externalizable
ShortHashBag is similar toHashBag, and is memory-optimized for short primitives. This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ShortHashBag()ShortHashBag(int size)ShortHashBag(short... elements)ShortHashBag(ShortIterable iterable)ShortHashBag(ShortHashBag bag)
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractShortIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableShortBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.ShortBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.ShortIterable
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
-
-
-
-
Constructor Detail
-
ShortHashBag
public ShortHashBag()
-
ShortHashBag
public ShortHashBag(int size)
-
ShortHashBag
public ShortHashBag(ShortIterable iterable)
-
ShortHashBag
public ShortHashBag(short... elements)
-
ShortHashBag
public ShortHashBag(ShortHashBag bag)
-
-
Method Detail
-
newBag
public static ShortHashBag newBag(int size)
-
newBagWith
public static ShortHashBag newBagWith(short... source)
-
newBag
public static ShortHashBag newBag(ShortIterable source)
-
newBag
public static ShortHashBag newBag(ShortBag 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 interfaceShortBag
-
clear
public void clear()
- Specified by:
clearin interfaceMutableShortCollection
-
with
public ShortHashBag with(short element)
- Specified by:
within interfaceMutableShortBag- Specified by:
within interfaceMutableShortCollection
-
with
public ShortHashBag with(short element1, short element2)
-
with
public ShortHashBag with(short element1, short element2, short element3)
-
withAll
public ShortHashBag withAll(ShortIterable iterable)
- Specified by:
withAllin interfaceMutableShortBag- Specified by:
withAllin interfaceMutableShortCollection
-
without
public ShortHashBag without(short element)
- Specified by:
withoutin interfaceMutableShortBag- Specified by:
withoutin interfaceMutableShortCollection
-
withoutAll
public ShortHashBag withoutAll(ShortIterable iterable)
- Specified by:
withoutAllin interfaceMutableShortBag- Specified by:
withoutAllin interfaceMutableShortCollection
-
contains
public boolean contains(short value)
- Specified by:
containsin interfaceShortIterable
-
occurrencesOf
public int occurrencesOf(short item)
- Specified by:
occurrencesOfin interfaceShortBag
-
forEachWithOccurrences
public void forEachWithOccurrences(ShortIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceShortBag
-
selectByOccurrences
public ShortHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceMutableShortBag- Specified by:
selectByOccurrencesin interfaceShortBag
-
selectUnique
public MutableShortSet selectUnique()
- Specified by:
selectUniquein interfaceMutableShortBag- Specified by:
selectUniquein interfaceShortBag
-
topOccurrences
public MutableList<ShortIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceMutableShortBag- Specified by:
topOccurrencesin interfaceShortBag
-
bottomOccurrences
public MutableList<ShortIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrencesin interfaceMutableShortBag- Specified by:
bottomOccurrencesin interfaceShortBag
-
add
public boolean add(short item)
- Specified by:
addin interfaceMutableShortCollection
-
remove
public boolean remove(short item)
- Specified by:
removein interfaceMutableShortCollection
-
removeIf
public boolean removeIf(ShortPredicate predicate)
- Specified by:
removeIfin interfaceMutableShortCollection
-
addAll
public boolean addAll(short... source)
- Specified by:
addAllin interfaceMutableShortCollection
-
addAll
public boolean addAll(ShortIterable source)
- Specified by:
addAllin interfaceMutableShortCollection
-
removeAll
public boolean removeAll(short... source)
- Specified by:
removeAllin interfaceMutableShortCollection
-
removeAll
public boolean removeAll(ShortIterable source)
- Specified by:
removeAllin interfaceMutableShortCollection
-
retainAll
public boolean retainAll(ShortIterable source)
- Specified by:
retainAllin interfaceMutableShortCollection
-
retainAll
public boolean retainAll(short... source)
- Specified by:
retainAllin interfaceMutableShortCollection
-
addOccurrences
public void addOccurrences(short item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableShortBag
-
removeOccurrences
public boolean removeOccurrences(short item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableShortBag
-
each
public void each(ShortProcedure procedure)
- Specified by:
eachin interfaceShortIterable- Since:
- 7.0.
-
select
public ShortHashBag select(ShortPredicate predicate)
- Specified by:
selectin interfaceMutableShortBag- Specified by:
selectin interfaceMutableShortCollection- Specified by:
selectin interfaceShortBag- Specified by:
selectin interfaceShortIterable
-
reject
public ShortHashBag reject(ShortPredicate predicate)
- Specified by:
rejectin interfaceMutableShortBag- Specified by:
rejectin interfaceMutableShortCollection- Specified by:
rejectin interfaceShortBag- Specified by:
rejectin interfaceShortIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectShortToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceShortIterable
-
chunk
public RichIterable<ShortIterable> chunk(int size)
- Specified by:
chunkin interfaceShortIterable
-
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(ShortPredicate predicate)
- Specified by:
countin interfaceShortIterable
-
anySatisfy
public boolean anySatisfy(ShortPredicate predicate)
- Specified by:
anySatisfyin interfaceShortIterable
-
allSatisfy
public boolean allSatisfy(ShortPredicate predicate)
- Specified by:
allSatisfyin interfaceShortIterable
-
noneSatisfy
public boolean noneSatisfy(ShortPredicate predicate)
- Specified by:
noneSatisfyin interfaceShortIterable
-
detectIfNone
public short detectIfNone(ShortPredicate predicate, short ifNone)
- Specified by:
detectIfNonein interfaceShortIterable
-
collect
public <V> MutableBag<V> collect(ShortToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceMutableShortBag- Specified by:
collectin interfaceMutableShortCollection- Specified by:
collectin interfaceShortBag- Specified by:
collectin interfaceShortIterable
-
max
public short max()
- Specified by:
maxin interfaceShortIterable
-
min
public short min()
- Specified by:
minin interfaceShortIterable
-
sum
public long sum()
- Specified by:
sumin interfaceShortIterable
-
toArray
public short[] toArray()
- Specified by:
toArrayin interfaceShortIterable
-
toArray
public short[] toArray(short[] array)
- Specified by:
toArrayin interfaceShortIterable
-
asUnmodifiable
public MutableShortBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableShortBag- Specified by:
asUnmodifiablein interfaceMutableShortCollection
-
asSynchronized
public MutableShortBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableShortBag- Specified by:
asSynchronizedin interfaceMutableShortCollection
-
toImmutable
public ImmutableShortBag toImmutable()
- Specified by:
toImmutablein interfaceMutableShortBag- Specified by:
toImmutablein interfaceMutableShortCollection- Specified by:
toImmutablein interfaceShortBag
-
newEmpty
public ShortHashBag newEmpty()
Creates a new empty ShortHashBag.- Specified by:
newEmptyin interfaceMutableShortBag- Specified by:
newEmptyin interfaceMutableShortCollection- Since:
- 9.2.
-
shortIterator
public MutableShortIterator shortIterator()
- Specified by:
shortIteratorin interfaceMutableShortCollection- Specified by:
shortIteratorin interfaceShortIterable
-
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
-
-