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

public Class ShortArrayList

extends AbstractShortIterable
implements MutableShortList, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.list.primitive.MutableShortList, org.eclipse.collections.api.list.primitive.ShortList, org.eclipse.collections.api.ordered.primitive.ReversibleShortIterable, org.eclipse.collections.api.ordered.primitive.OrderedShortIterable, 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.Arrays, .Collection, .Iterator, .NoSuchElementException, org.eclipse.collections.api.ShortIterable, .LazyShortIterable, .RichIterable, org.eclipse.collections.api.block.comparator.primitive.ShortComparator, org.eclipse.collections.api.block.function.primitive.ObjectShortIntToObjectFunction, .ObjectShortToObjectFunction, .ShortToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.ShortPredicate, org.eclipse.collections.api.block.procedure.primitive.ShortIntProcedure, .ShortProcedure, org.eclipse.collections.api.collection.primitive.MutableShortCollection, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.iterator.MutableShortIterator, .ShortIterator, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.list.primitive.ShortList, .ImmutableShortList, .MutableShortList, org.eclipse.collections.api.set.primitive.ShortSet, .MutableShortSet, org.eclipse.collections.api.stack.primitive.MutableShortStack, org.eclipse.collections.api.tuple.primitive.ShortShortPair, .ShortObjectPair, org.eclipse.collections.impl.factory.primitive.ShortLists, .ShortStacks, org.eclipse.collections.impl.lazy.primitive.ReverseShortIterable, org.eclipse.collections.impl.primitive.AbstractShortIterable, org.eclipse.collections.impl.set.mutable.primitive.ShortHashSet, org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples, org.eclipse.collections.impl.utility.Iterate, org.eclipse.collections.impl.utility.primitive.ShortQuickSort

ShortArrayList is similar to FastList, and is memory-optimized for short primitives. This file was automatically generated from template file primitiveArrayList.stg.
Since
3.0.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private static final short[]
protected transient short[]
private static final int
private static final long
protected int
private static final short[]

Constructor Summary

AccessConstructor and Description
public
public
ShortArrayList(int initialCapacity)

public
ShortArrayList(short... array)

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public boolean
public boolean
public boolean
public void
private void
addAtIndexLessThanSize(int index, short element)

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 LazyShortIterable
public MutableShortList
public MutableShortList
public int
public MutableList<Short>
private void
public RichIterable<ShortIterable>
chunk(int size)

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

Partitions elements in fixed size chunks.

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

Implements org.eclipse.collections.api.list.primitive.MutableShortList.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 <V, R extends Collection<V>> R
collect(ShortToObjectFunction<? extends V> function, R target)

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

Same as collect(ShortToObjectFunction) , only the results are added to the target 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.

private void
copyItems(int sourceSize, short[] source)

private short[]
copyItemsWithNewCapacity(int newCapacity)

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 MutableShortList
public long
public void
each(ShortProcedure procedure)

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

A synonym for forEach.

public void
ensureCapacity(int minCapacity)

private void
public boolean
public void
public short
public short
public short
public int
public int
public <T> T
injectInto(T injectedValue, ObjectShortToObjectFunction<? super T, ? extends T> function)

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

public <T> T
public int
public short
public short
public ShortArrayList
newEmpty()

Overrides default org.eclipse.collections.api.list.primitive.MutableShortList.newEmpty.

Creates a new empty ShortArrayList.

private IndexOutOfBoundsException
public static ShortArrayList
public static ShortArrayList
newListWith(short... elements)

Creates a new list using the passed elements argument as the backing store.

public static ShortArrayList
newWithNValues(int size, short value)

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 ShortArrayList
reject(ShortPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.MutableShortList.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 <R extends MutableShortCollection> R
reject(ShortPredicate predicate, R target)

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

Same as reject(ShortPredicate) , only the results are added to the target MutableShortCollection.

public boolean
public boolean
public boolean
public short
public boolean
public boolean
public boolean
public ShortArrayList
public ShortArrayList
select(ShortPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.MutableShortList.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 <R extends MutableShortCollection> R
select(ShortPredicate predicate, R target)

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

Same as select(ShortPredicate) , only the results are added to the target MutableShortCollection.

public short
private void
shiftElementsAtIndex(int index, int sourceSize)

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.

private int
sizePlusFiftyPercent(int oldSize)

public ShortArrayList
sortThis()

Implements org.eclipse.collections.api.list.primitive.MutableShortList.sortThis.

Sorts this list mutating its contents and returns the same mutable list (this).

public ShortArrayList
sortThis(ShortComparator comparator)

Overrides default org.eclipse.collections.api.list.primitive.MutableShortList.sortThis.

Sorts the internal data structure of this list and returns the list itself as a convenience.

public MutableShortList
public long
public void
private void
throwOutOfBounds(int index)

public short[]
toArray()

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

Converts the ShortIterable to a primitive short array.

public short[]
toArray(short[] target)

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

Converts the ShortIterable to a primitive short array.

public ImmutableShortList
toImmutable()

Implements org.eclipse.collections.api.list.primitive.MutableShortList.toImmutable.

Returns an immutable copy of this list.

public ShortArrayList
public MutableShortStack
toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedShortIterable.toStack.

Converts the collection to a ShortStack.

private void
public void
private void
wipeAndResetTheEnd(int newCurrentFilledIndex)

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

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

public ShortArrayList
with(short element1, short element2, short element3, short... elements)

public ShortArrayList
private ShortArrayList
withArrayCopy(short[] elements, int begin, int length)

public ShortArrayList
public ShortArrayList
public static ShortArrayList
wrapCopy(short... array)

Creates a new list by first copying the array passed in.

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.

public <T> MutableList<ShortObjectPair<T>>
zip(Iterable<T> iterable)

Overrides default org.eclipse.collections.api.list.primitive.MutableShortList.zip.

Returns a MutableList formed from this MutableShortList and a ListIterable by combining corresponding elements in pairs.

public MutableList<ShortShortPair>
zipShort(ShortIterable iterable)

Overrides default org.eclipse.collections.api.list.primitive.MutableShortList.zipShort.

Returns a MutableList formed from this MutableShortList and another ShortList by combining corresponding elements in pairs.

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