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:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmpty
in interfacePrimitiveIterable
-
size
public int size()
- Specified by:
size
in interfacePrimitiveIterable
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinct
in interfaceShortBag
-
clear
public void clear()
- Specified by:
clear
in interfaceMutableShortCollection
-
with
public ShortHashBag with(short element)
- Specified by:
with
in interfaceMutableShortBag
- Specified by:
with
in 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:
withAll
in interfaceMutableShortBag
- Specified by:
withAll
in interfaceMutableShortCollection
-
without
public ShortHashBag without(short element)
- Specified by:
without
in interfaceMutableShortBag
- Specified by:
without
in interfaceMutableShortCollection
-
withoutAll
public ShortHashBag withoutAll(ShortIterable iterable)
- Specified by:
withoutAll
in interfaceMutableShortBag
- Specified by:
withoutAll
in interfaceMutableShortCollection
-
contains
public boolean contains(short value)
- Specified by:
contains
in interfaceShortIterable
-
occurrencesOf
public int occurrencesOf(short item)
- Specified by:
occurrencesOf
in interfaceShortBag
-
forEachWithOccurrences
public void forEachWithOccurrences(ShortIntProcedure procedure)
- Specified by:
forEachWithOccurrences
in interfaceShortBag
-
selectByOccurrences
public ShortHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrences
in interfaceMutableShortBag
- Specified by:
selectByOccurrences
in interfaceShortBag
-
selectUnique
public MutableShortSet selectUnique()
- Specified by:
selectUnique
in interfaceMutableShortBag
- Specified by:
selectUnique
in interfaceShortBag
-
topOccurrences
public MutableList<ShortIntPair> topOccurrences(int count)
- Specified by:
topOccurrences
in interfaceMutableShortBag
- Specified by:
topOccurrences
in interfaceShortBag
-
bottomOccurrences
public MutableList<ShortIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrences
in interfaceMutableShortBag
- Specified by:
bottomOccurrences
in interfaceShortBag
-
add
public boolean add(short item)
- Specified by:
add
in interfaceMutableShortCollection
-
remove
public boolean remove(short item)
- Specified by:
remove
in interfaceMutableShortCollection
-
removeIf
public boolean removeIf(ShortPredicate predicate)
- Specified by:
removeIf
in interfaceMutableShortCollection
-
addAll
public boolean addAll(short... source)
- Specified by:
addAll
in interfaceMutableShortCollection
-
addAll
public boolean addAll(ShortIterable source)
- Specified by:
addAll
in interfaceMutableShortCollection
-
removeAll
public boolean removeAll(short... source)
- Specified by:
removeAll
in interfaceMutableShortCollection
-
removeAll
public boolean removeAll(ShortIterable source)
- Specified by:
removeAll
in interfaceMutableShortCollection
-
retainAll
public boolean retainAll(ShortIterable source)
- Specified by:
retainAll
in interfaceMutableShortCollection
-
retainAll
public boolean retainAll(short... source)
- Specified by:
retainAll
in interfaceMutableShortCollection
-
addOccurrences
public void addOccurrences(short item, int occurrences)
- Specified by:
addOccurrences
in interfaceMutableShortBag
-
removeOccurrences
public boolean removeOccurrences(short item, int occurrences)
- Specified by:
removeOccurrences
in interfaceMutableShortBag
-
each
public void each(ShortProcedure procedure)
- Specified by:
each
in interfaceShortIterable
- Since:
- 7.0.
-
select
public ShortHashBag select(ShortPredicate predicate)
- Specified by:
select
in interfaceMutableShortBag
- Specified by:
select
in interfaceMutableShortCollection
- Specified by:
select
in interfaceShortBag
- Specified by:
select
in interfaceShortIterable
-
reject
public ShortHashBag reject(ShortPredicate predicate)
- Specified by:
reject
in interfaceMutableShortBag
- Specified by:
reject
in interfaceMutableShortCollection
- Specified by:
reject
in interfaceShortBag
- Specified by:
reject
in interfaceShortIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectShortToObjectFunction<? super T,? extends T> function)
- Specified by:
injectInto
in interfaceShortIterable
-
chunk
public RichIterable<ShortIterable> chunk(int size)
- Specified by:
chunk
in 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:
appendString
in interfacePrimitiveIterable
-
count
public int count(ShortPredicate predicate)
- Specified by:
count
in interfaceShortIterable
-
anySatisfy
public boolean anySatisfy(ShortPredicate predicate)
- Specified by:
anySatisfy
in interfaceShortIterable
-
allSatisfy
public boolean allSatisfy(ShortPredicate predicate)
- Specified by:
allSatisfy
in interfaceShortIterable
-
noneSatisfy
public boolean noneSatisfy(ShortPredicate predicate)
- Specified by:
noneSatisfy
in interfaceShortIterable
-
detectIfNone
public short detectIfNone(ShortPredicate predicate, short ifNone)
- Specified by:
detectIfNone
in interfaceShortIterable
-
collect
public <V> MutableBag<V> collect(ShortToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceMutableShortBag
- Specified by:
collect
in interfaceMutableShortCollection
- Specified by:
collect
in interfaceShortBag
- Specified by:
collect
in interfaceShortIterable
-
max
public short max()
- Specified by:
max
in interfaceShortIterable
-
min
public short min()
- Specified by:
min
in interfaceShortIterable
-
sum
public long sum()
- Specified by:
sum
in interfaceShortIterable
-
toArray
public short[] toArray()
- Specified by:
toArray
in interfaceShortIterable
-
toArray
public short[] toArray(short[] array)
- Specified by:
toArray
in interfaceShortIterable
-
asUnmodifiable
public MutableShortBag asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableShortBag
- Specified by:
asUnmodifiable
in interfaceMutableShortCollection
-
asSynchronized
public MutableShortBag asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableShortBag
- Specified by:
asSynchronized
in interfaceMutableShortCollection
-
toImmutable
public ImmutableShortBag toImmutable()
- Specified by:
toImmutable
in interfaceMutableShortBag
- Specified by:
toImmutable
in interfaceMutableShortCollection
- Specified by:
toImmutable
in interfaceShortBag
-
newEmpty
public ShortHashBag newEmpty()
Creates a new empty ShortHashBag.- Specified by:
newEmpty
in interfaceMutableShortBag
- Specified by:
newEmpty
in interfaceMutableShortCollection
- Since:
- 9.2.
-
shortIterator
public MutableShortIterator shortIterator()
- Specified by:
shortIterator
in interfaceMutableShortCollection
- Specified by:
shortIterator
in interfaceShortIterable
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
-