Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.bag.mutable.primitive

public Class ShortHashBag

extends AbstractShortIterable
implements MutableShortBag, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.bag.primitive.MutableShortBag, org.eclipse.collections.api.bag.primitive.ShortBag, org.eclipse.collections.api.ShortIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.collection.primitive.MutableShortCollection
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.util.NoSuchElementException, org.eclipse.collections.api.ShortIterable, .RichIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.ShortBag, .ImmutableShortBag, .MutableShortBag, org.eclipse.collections.api.block.function.primitive.ShortToObjectFunction, .IntFunction, .ObjectShortToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.IntPredicate, .ShortPredicate, org.eclipse.collections.api.block.procedure.primitive.ShortProcedure, .ShortIntProcedure, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.iterator.ShortIterator, .MutableShortIterator, org.eclipse.collections.api.set.primitive.ShortSet, .MutableShortSet, org.eclipse.collections.api.tuple.primitive.ShortIntPair, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.impl.Counter, org.eclipse.collections.impl.bag.mutable.HashBag, org.eclipse.collections.impl.block.factory.primitive.IntToIntFunctions, org.eclipse.collections.impl.factory.primitive.ShortBags, .ShortSets, org.eclipse.collections.impl.map.mutable.primitive.ShortIntHashMap, org.eclipse.collections.impl.primitive.AbstractShortIterable, org.eclipse.collections.impl.set.mutable.primitive.ShortHashSet, org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples

ShortHashBag is similar to HashBag, and is memory-optimized for short primitives. This file was automatically generated from template file primitiveHashBag.stg.
Since
3.0.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private ShortIntHashMap
private static final long
private int

Constructor Summary

AccessConstructor and Description
public
public
ShortHashBag(int size)

public
public
ShortHashBag(short... elements)

public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public boolean
public void
public boolean
allSatisfy(ShortPredicate predicate)

Implements org.eclipse.collections.api.ShortIterable.allSatisfy.

Returns true if all of the elements in the ShortIterable return true for the specified predicate, otherwise returns false.

public boolean
anySatisfy(ShortPredicate predicate)

Implements org.eclipse.collections.api.ShortIterable.anySatisfy.

Returns true if any of the elements in the ShortIterable return true for the specified predicate, otherwise returns false.

public void
appendString(Appendable appendable, String start, String separator, String end)

Implements org.eclipse.collections.api.PrimitiveIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public MutableShortBag
public MutableShortBag
public MutableList<ShortIntPair>
bottomOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.bottomOccurrences.

Returns the count least frequently occurring items.

public RichIterable<ShortIterable>
chunk(int size)

Overrides default org.eclipse.collections.api.ShortIterable.chunk.

Partitions elements in fixed size chunks.

public void
public <V> MutableBag<V>
collect(ShortToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.collect, org.eclipse.collections.api.ShortIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public boolean
contains(short value)

Implements org.eclipse.collections.api.ShortIterable.contains.

Returns true if the value is contained in the ShortIterable, and false if it is not.

public int
count(ShortPredicate predicate)

Implements org.eclipse.collections.api.ShortIterable.count.

Returns a count of the number of elements in the ShortIterable that return true for the specified predicate.

public short
public void
each(ShortProcedure procedure)

Implements org.eclipse.collections.api.ShortIterable.each.

A synonym for forEach.

public boolean
equals(Object otherBag)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.bag.primitive.ShortBag.equals.

Follows the same general contract as Bag#equals(Object).

public void
forEachWithOccurrences(ShortIntProcedure procedure)

Implements org.eclipse.collections.api.bag.primitive.ShortBag.forEachWithOccurrences.

For each distinct item, with the number of occurrences, execute the specified procedure.

public int
public <T> T
injectInto(T injectedValue, ObjectShortToObjectFunction<? super T, ? extends T> function)

Implements org.eclipse.collections.api.ShortIterable.injectInto.

public boolean
isEmpty()

Overrides default org.eclipse.collections.api.PrimitiveIterable.isEmpty.

Returns true if this iterable has zero items.

public short
public short
public static ShortHashBag
newBag(int size)

public static ShortHashBag
public static ShortHashBag
newBag(ShortBag source)

public static ShortHashBag
newBagWith(short... source)

public ShortHashBag
newEmpty()

Overrides default org.eclipse.collections.api.bag.primitive.MutableShortBag.newEmpty.

Creates a new empty ShortHashBag.

public boolean
noneSatisfy(ShortPredicate predicate)

Overrides default org.eclipse.collections.api.ShortIterable.noneSatisfy.

Returns true if none of the elements in the ShortIterable return true for the specified predicate, otherwise returns false.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.PrimitiveIterable.notEmpty.

The English equivalent of !this.isEmpty()

public int
occurrencesOf(short item)

Implements org.eclipse.collections.api.bag.primitive.ShortBag.occurrencesOf.

The occurrences of a distinct item in the bag.

protected MutableList<ShortIntPair>
public void
readExternal(ObjectInput in)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public ShortHashBag
reject(ShortPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.reject, org.eclipse.collections.api.ShortIterable.reject.

Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public ShortHashBag
select(ShortPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.select, org.eclipse.collections.api.ShortIterable.select.

Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.

public ShortHashBag
selectByOccurrences(IntPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

public MutableShortSet
selectUnique()

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.selectUnique.

Returns all elements of the bag that have exactly one occurrence.

public MutableShortIterator
shortIterator()

Implements org.eclipse.collections.api.collection.primitive.MutableShortCollection.shortIterator, org.eclipse.collections.api.ShortIterable.shortIterator.

Returns a primitive iterator that can be used to iterate over the ShortIterable in an imperative style.

public int
size()

Implements org.eclipse.collections.api.PrimitiveIterable.size.

Returns the number of items in this iterable.

public int
sizeDistinct()

Implements org.eclipse.collections.api.bag.primitive.ShortBag.sizeDistinct.

The size of the Bag when counting only distinct elements.

public long
public short[]
toArray()

Implements org.eclipse.collections.api.ShortIterable.toArray.

Converts the ShortIterable to a primitive short array.

public short[]
toArray(short[] array)

Overrides default org.eclipse.collections.api.ShortIterable.toArray.

Converts the ShortIterable to a primitive short array.

public ImmutableShortBag
toImmutable()

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.toImmutable.

Returns an immutable copy of this bag.

protected MutableList<ShortIntPair>
public MutableList<ShortIntPair>
topOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableShortBag.topOccurrences.

Returns the count most frequently occurring items.

public ShortHashBag
public ShortHashBag
with(short element1, short element2)

public ShortHashBag
with(short element1, short element2, short element3)

public ShortHashBag
public ShortHashBag
public ShortHashBag
public void
writeExternal(ObjectOutput out)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.primitive.AbstractShortIterable:
asLazyaveragemaxIfEmptymedianminIfEmptytoBagtoListtoSettoSortedArraytoSortedListtoString