Class ShortArrayList
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractShortIterable
org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList
- All Implemented Interfaces:
Externalizable,Serializable,MutableShortCollection,MutableShortList,ShortList,OrderedShortIterable,ReversibleShortIterable,PrimitiveIterable,ShortIterable
public class ShortArrayList
extends AbstractShortIterable
implements MutableShortList, Externalizable
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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(short newItem) booleanaddAll(short... source) booleanaddAll(ShortIterable source) booleanaddAllAtIndex(int index, short... source) booleanaddAllAtIndex(int index, ShortIterable source) voidaddAtIndex(int index, short element) booleanallSatisfy(ShortPredicate predicate) booleananySatisfy(ShortPredicate predicate) voidappendString(Appendable appendable, String start, String separator, String end) intbinarySearch(short value) boxed()chunk(int size) voidclear()<V> MutableList<V>collect(ShortToObjectFunction<? extends V> function) <V,R extends Collection<V>>
Rcollect(ShortToObjectFunction<? extends V> function, R target) booleancontains(short value) intcount(ShortPredicate predicate) shortdetectIfNone(ShortPredicate predicate, short ifNone) distinct()longdotProduct(ShortList list) voideach(ShortProcedure procedure) voidensureCapacity(int minCapacity) booleanvoidforEachWithIndex(ShortIntProcedure procedure) shortget(int index) shortgetFirst()shortgetLast()inthashCode()intindexOf(short value) <T> TinjectInto(T injectedValue, ObjectShortToObjectFunction<? super T, ? extends T> function) <T> TinjectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T, ? extends T> function) intlastIndexOf(short value) shortmax()shortmin()newEmpty()Creates a new empty ShortArrayList.static ShortArrayListnewList(ShortIterable source) static ShortArrayListnewListWith(short... elements) Creates a new list using the passedelementsargument as the backing store.static ShortArrayListnewWithNValues(int size, short value) voidreject(ShortPredicate predicate) <R extends MutableShortCollection>
Rreject(ShortPredicate predicate, R target) booleanremove(short value) booleanremoveAll(short... source) booleanremoveAll(ShortIterable source) shortremoveAtIndex(int index) booleanremoveIf(ShortPredicate predicate) booleanretainAll(short... source) booleanretainAll(ShortIterable source) select(ShortPredicate predicate) <R extends MutableShortCollection>
Rselect(ShortPredicate predicate, R target) shortset(int index, short element) intsize()sortThis()sortThis(ShortComparator comparator) subList(int fromIndex, int toIndex) longsum()voidswap(int index1, int index2) short[]toArray()short[]toArray(short[] target) toStack()voidwith(short element) with(short element1, short element2) with(short element1, short element2, short element3) with(short element1, short element2, short element3, short... elements) withAll(ShortIterable elements) without(short element) withoutAll(ShortIterable elements) static ShortArrayListwrapCopy(short... array) Creates a new list by first copying the array passed in.void<T> MutableList<ShortObjectPair<T>>zipShort(ShortIterable iterable) Methods inherited from class org.eclipse.collections.impl.primitive.AbstractShortIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods inherited from interface org.eclipse.collections.api.list.primitive.MutableShortList
collectWithIndex, rejectWithIndex, selectWithIndex, shuffleThis, shuffleThis, sortThisBy, sortThisBy, tapMethods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedShortIterable
collectWithIndex, rejectWithIndex, selectWithIndexMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toStringMethods inherited from interface org.eclipse.collections.api.ShortIterable
asLazy, average, averageIfEmpty, 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, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface org.eclipse.collections.api.list.primitive.ShortList
forEachInBoth
-
Constructor Details
-
ShortArrayList
public ShortArrayList() -
ShortArrayList
public ShortArrayList(int initialCapacity) -
ShortArrayList
public ShortArrayList(short... array)
-
-
Method Details
-
newListWith
Creates a new list using the passedelementsargument as the backing store.!!! WARNING: This method uses the passed in array, so can be very unsafe if the original array is held onto anywhere else. !!!
-
newList
-
newWithNValues
-
wrapCopy
Creates a new list by first copying the array passed in. -
size
public int size()- Specified by:
sizein interfacePrimitiveIterable
-
clear
public void clear()- Specified by:
clearin interfaceMutableShortCollection
-
contains
public boolean contains(short value) - Specified by:
containsin interfaceShortIterable
-
get
public short get(int index) -
getFirst
public short getFirst()- Specified by:
getFirstin interfaceOrderedShortIterable
-
getLast
public short getLast()- Specified by:
getLastin interfaceReversibleShortIterable
-
indexOf
public int indexOf(short value) - Specified by:
indexOfin interfaceOrderedShortIterable
-
lastIndexOf
public int lastIndexOf(short value) - Specified by:
lastIndexOfin interfaceShortList
-
trimToSize
public void trimToSize() -
ensureCapacity
public void ensureCapacity(int minCapacity) -
add
public boolean add(short newItem) - Specified by:
addin interfaceMutableShortCollection
-
addAll
public boolean addAll(short... source) - Specified by:
addAllin interfaceMutableShortCollection
-
addAll
- Specified by:
addAllin interfaceMutableShortCollection
-
addAtIndex
public void addAtIndex(int index, short element) - Specified by:
addAtIndexin interfaceMutableShortList
-
addAllAtIndex
public boolean addAllAtIndex(int index, short... source) - Specified by:
addAllAtIndexin interfaceMutableShortList
-
addAllAtIndex
- Specified by:
addAllAtIndexin interfaceMutableShortList
-
remove
public boolean remove(short value) - Specified by:
removein interfaceMutableShortCollection
-
removeIf
- Specified by:
removeIfin interfaceMutableShortCollection
-
removeAll
- Specified by:
removeAllin interfaceMutableShortCollection
-
removeAll
public boolean removeAll(short... source) - Specified by:
removeAllin interfaceMutableShortCollection
-
retainAll
- Specified by:
retainAllin interfaceMutableShortCollection
-
retainAll
public boolean retainAll(short... source) - Specified by:
retainAllin interfaceMutableShortCollection
-
removeAtIndex
public short removeAtIndex(int index) - Specified by:
removeAtIndexin interfaceMutableShortList
-
set
public short set(int index, short element) - Specified by:
setin interfaceMutableShortList
-
swap
public void swap(int index1, int index2) - Specified by:
swapin interfaceMutableShortList
-
with
- Specified by:
within interfaceMutableShortCollection- Specified by:
within interfaceMutableShortList
-
without
- Specified by:
withoutin interfaceMutableShortCollection- Specified by:
withoutin interfaceMutableShortList
-
withAll
- Specified by:
withAllin interfaceMutableShortCollection- Specified by:
withAllin interfaceMutableShortList
-
withoutAll
- Specified by:
withoutAllin interfaceMutableShortCollection- Specified by:
withoutAllin interfaceMutableShortList
-
with
-
with
-
with
-
shortIterator
- Specified by:
shortIteratorin interfaceMutableShortCollection- Specified by:
shortIteratorin interfaceShortIterable
-
each
- Specified by:
eachin interfaceShortIterable- Since:
- 7.0.
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedShortIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectShortToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoin interfaceShortIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoWithIndexin interfaceOrderedShortIterable- Specified by:
injectIntoWithIndexin interfaceReversibleShortIterable
-
chunk
- Specified by:
chunkin interfaceShortIterable
-
count
- Specified by:
countin interfaceShortIterable
-
anySatisfy
- Specified by:
anySatisfyin interfaceShortIterable
-
allSatisfy
- Specified by:
allSatisfyin interfaceShortIterable
-
select
- Specified by:
selectin interfaceMutableShortCollection- Specified by:
selectin interfaceMutableShortList- Specified by:
selectin interfaceOrderedShortIterable- Specified by:
selectin interfaceReversibleShortIterable- Specified by:
selectin interfaceShortIterable- Specified by:
selectin interfaceShortList
-
select
- Specified by:
selectin interfaceShortIterable- Since:
- 8.1.
-
reject
- Specified by:
rejectin interfaceMutableShortCollection- Specified by:
rejectin interfaceMutableShortList- Specified by:
rejectin interfaceOrderedShortIterable- Specified by:
rejectin interfaceReversibleShortIterable- Specified by:
rejectin interfaceShortIterable- Specified by:
rejectin interfaceShortList
-
reject
- Specified by:
rejectin interfaceShortIterable- Since:
- 8.1.
-
detectIfNone
- Specified by:
detectIfNonein interfaceShortIterable
-
collect
- Specified by:
collectin interfaceMutableShortCollection- Specified by:
collectin interfaceMutableShortList- Specified by:
collectin interfaceOrderedShortIterable- Specified by:
collectin interfaceReversibleShortIterable- Specified by:
collectin interfaceShortIterable- Specified by:
collectin interfaceShortList
-
collect
public <V,R extends Collection<V>> R collect(ShortToObjectFunction<? extends V> function, R target) - Specified by:
collectin interfaceShortIterable- Since:
- 8.1.
-
max
public short max()- Specified by:
maxin interfaceShortIterable
-
min
public short min()- Specified by:
minin interfaceShortIterable
-
sum
public long sum()- Specified by:
sumin interfaceShortIterable
-
dotProduct
- Specified by:
dotProductin interfaceShortList
-
toArray
public short[] toArray()- Specified by:
toArrayin interfaceShortIterable
-
toArray
public short[] toArray(short[] target) - Specified by:
toArrayin interfaceShortIterable
-
equals
-
hashCode
public int hashCode() -
appendString
- Specified by:
appendStringin interfacePrimitiveIterable
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableShortCollection- Specified by:
asUnmodifiablein interfaceMutableShortList
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableShortCollection- Specified by:
asSynchronizedin interfaceMutableShortList
-
toImmutable
- Specified by:
toImmutablein interfaceMutableShortCollection- Specified by:
toImmutablein interfaceMutableShortList- Specified by:
toImmutablein interfaceShortList
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
asReversed
- Specified by:
asReversedin interfaceReversibleShortIterable
-
reverseThis
- Specified by:
reverseThisin interfaceMutableShortList
-
sortThis
- Specified by:
sortThisin interfaceMutableShortList
-
sortThis
- Specified by:
sortThisin interfaceMutableShortList
-
toReversed
- Specified by:
toReversedin interfaceMutableShortList- Specified by:
toReversedin interfaceReversibleShortIterable- Specified by:
toReversedin interfaceShortList
-
binarySearch
public int binarySearch(short value) - Specified by:
binarySearchin interfaceShortList
-
distinct
- Specified by:
distinctin interfaceMutableShortList- Specified by:
distinctin interfaceReversibleShortIterable- Specified by:
distinctin interfaceShortList
-
subList
- Specified by:
subListin interfaceMutableShortList- Specified by:
subListin interfaceShortList
-
zipShort
- Specified by:
zipShortin interfaceMutableShortList- Specified by:
zipShortin interfaceShortList- Since:
- 9.1.
-
newEmpty
Creates a new empty ShortArrayList.- Specified by:
newEmptyin interfaceMutableShortCollection- Specified by:
newEmptyin interfaceMutableShortList- Since:
- 9.2.
-
zip
- Specified by:
zipin interfaceMutableShortList- Specified by:
zipin interfaceShortList- Since:
- 9.1.
-
boxed
- Specified by:
boxedin interfaceMutableShortList
-
toStack
- Specified by:
toStackin interfaceOrderedShortIterable
-