Class SynchronizedShortList
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedShortCollection
org.eclipse.collections.impl.list.mutable.primitive.SynchronizedShortList
- All Implemented Interfaces:
Serializable, MutableShortCollection, MutableShortList, ShortList, OrderedShortIterable, ReversibleShortIterable, PrimitiveIterable, ShortIterable
public class SynchronizedShortList
extends AbstractSynchronizedShortCollection
implements MutableShortList
A synchronized view of a
MutableShortList. It is imperative that the user manually synchronize on the on the
collection when iterating over it using an iterator or stream.
This file was automatically generated from template file synchronizedPrimitiveList.stg.
- Since:
- 3.1.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAllAtIndex(int index, short... source) booleanaddAllAtIndex(int index, ShortIterable source) voidaddAtIndex(int index, short element) asLazy()Returns a LazyShortIterable adapter wrapping the source ShortIterable.intbinarySearch(short value) boxed()<V> MutableList<V> collect(ShortToObjectFunction<? extends V> function) Returns a new collection with the results of applying the specified function on each element of the source collection.<V> MutableList<V> collectWithIndex(ShortIntToObjectFunction<? extends V> function) Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.<V, R extends Collection<V>>
RcollectWithIndex(ShortIntToObjectFunction<? extends V> function, R target) Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.distinct()longdotProduct(ShortList list) booleanFollows the same general contract asList.equals(Object).voidforEachInBoth(ShortList other, ShortShortProcedure procedure) This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.voidforEachWithIndex(ShortIntProcedure procedure) shortget(int index) shortgetFirst()shortgetLast()private MutableShortListinthashCode()Follows the same general contract asList.hashCode().intindexOf(short value) <T> TinjectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T, ? extends T> function) intlastIndexOf(short value) newEmpty()Creates a new empty mutable version of the same collection type.reject(ShortPredicate predicate) Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.rejectWithIndex(ShortIntPredicate predicate) Returns a new MutableShortList excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableShortCollection>
RrejectWithIndex(ShortIntPredicate predicate, R target) Returns a new MutableShortCollection excluding all elements with corresponding indexes matching the specified predicate.shortremoveAtIndex(int index) select(ShortPredicate predicate) Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.selectWithIndex(ShortIntPredicate predicate) Returns a new MutableShortList including all elements with corresponding indexes matching the specified predicate.<R extends MutableShortCollection>
RselectWithIndex(ShortIntPredicate predicate, R target) Returns a new MutableShortCollection including all elements with corresponding indexes matching the specified predicate.shortset(int index, short element) Randomly permutes this list mutating its contents and returns the same list (this).shuffleThis(Random rnd) Randomly permutes this list mutating its contents and returns the same list (this).sortThis()Sorts this list mutating its contents and returns the same mutable list (this).sortThis(ShortComparator comparator) Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableShortListsortThisBy(ShortToObjectFunction<T> function) Sorts the internal data structure of this list based on the natural order of the key returned byfunction.<T> MutableShortListsortThisBy(ShortToObjectFunction<T> function, Comparator<? super T> comparator) Sorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.subList(int fromIndex, int toIndex) Returns an immutable copy of this list.toStack()Converts the collection to a ShortStack.with(short element) withAll(ShortIterable elements) without(short element) withoutAll(ShortIterable elements) <T> MutableList<ShortObjectPair<T>> Returns aMutableListformed from thisMutableShortListand aListIterableby combining corresponding elements in pairs.zipShort(ShortIterable iterable) Returns aMutableListformed from thisMutableShortListand anotherShortListby combining corresponding elements in pairs.Methods inherited from class AbstractSynchronizedShortCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getLock, getShortCollection, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods inherited from interface MutableShortCollection
add, addAll, addAll, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIteratorMethods inherited from interface MutableShortList
swap, tapMethods inherited from interface PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringMethods inherited from interface ShortIterable
allSatisfy, anySatisfy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
SynchronizedShortList
-
SynchronizedShortList
-
-
Method Details
-
getMutableShortList
-
get
-
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
-
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
-
removeAtIndex
public short removeAtIndex(int index) - Specified by:
removeAtIndexin interfaceMutableShortList
-
set
public short set(int index, short element) - Specified by:
setin interfaceMutableShortList
-
with
- Specified by:
within interfaceMutableShortCollection- Specified by:
within interfaceMutableShortList- Overrides:
within classAbstractSynchronizedShortCollection
-
without
- Specified by:
withoutin interfaceMutableShortCollection- Specified by:
withoutin interfaceMutableShortList- Overrides:
withoutin classAbstractSynchronizedShortCollection
-
withAll
- Specified by:
withAllin interfaceMutableShortCollection- Specified by:
withAllin interfaceMutableShortList- Overrides:
withAllin classAbstractSynchronizedShortCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableShortCollection- Specified by:
withoutAllin interfaceMutableShortList- Overrides:
withoutAllin classAbstractSynchronizedShortCollection
-
select
Description copied from interface:ShortIterableReturns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.- Specified by:
selectin interfaceMutableShortCollection- Specified by:
selectin interfaceMutableShortList- Specified by:
selectin interfaceOrderedShortIterable- Specified by:
selectin interfaceReversibleShortIterable- Specified by:
selectin interfaceShortIterable- Specified by:
selectin interfaceShortList- Overrides:
selectin classAbstractSynchronizedShortCollection
-
boxed
- Specified by:
boxedin interfaceMutableShortList
-
reject
Description copied from interface:ShortIterableReturns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.- Specified by:
rejectin interfaceMutableShortCollection- Specified by:
rejectin interfaceMutableShortList- Specified by:
rejectin interfaceOrderedShortIterable- Specified by:
rejectin interfaceReversibleShortIterable- Specified by:
rejectin interfaceShortIterable- Specified by:
rejectin interfaceShortList- Overrides:
rejectin classAbstractSynchronizedShortCollection
-
collect
Description copied from interface:ShortIterableReturns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collectin interfaceMutableShortCollection- Specified by:
collectin interfaceMutableShortList- Specified by:
collectin interfaceOrderedShortIterable- Specified by:
collectin interfaceReversibleShortIterable- Specified by:
collectin interfaceShortIterable- Specified by:
collectin interfaceShortList- Overrides:
collectin classAbstractSynchronizedShortCollection
-
sortThis
Description copied from interface:MutableShortListSorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThisin interfaceMutableShortList
-
sortThis
Description copied from interface:MutableShortListSorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThisin interfaceMutableShortList
-
sortThisBy
Description copied from interface:MutableShortListSorts the internal data structure of this list based on the natural order of the key returned byfunction.- Specified by:
sortThisByin interfaceMutableShortList
-
sortThisBy
public <T> MutableShortList sortThisBy(ShortToObjectFunction<T> function, Comparator<? super T> comparator) Description copied from interface:MutableShortListSorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.- Specified by:
sortThisByin interfaceMutableShortList
-
shuffleThis
Description copied from interface:MutableShortListRandomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Randomas the source of randomness.- Specified by:
shuffleThisin interfaceMutableShortList
-
shuffleThis
Description copied from interface:MutableShortListRandomly permutes this list mutating its contents and returns the same list (this). Implements the Fisher-Yates shuffle algorithm using the provided source of randomness.- Specified by:
shuffleThisin interfaceMutableShortList
-
binarySearch
public int binarySearch(short value) - Specified by:
binarySearchin interfaceShortList
-
dotProduct
- Specified by:
dotProductin interfaceShortList
-
equals
-
hashCode
-
asLazy
Description copied from interface:ShortIterableReturns a LazyShortIterable adapter wrapping the source ShortIterable.- Specified by:
asLazyin interfaceShortIterable- Overrides:
asLazyin classAbstractSynchronizedShortCollection
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableShortCollection- Specified by:
asUnmodifiablein interfaceMutableShortList- Overrides:
asUnmodifiablein classAbstractSynchronizedShortCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableShortCollection- Specified by:
asSynchronizedin interfaceMutableShortList- Overrides:
asSynchronizedin classAbstractSynchronizedShortCollection
-
toImmutable
Description copied from interface:MutableShortListReturns an immutable copy of this list.- Specified by:
toImmutablein interfaceMutableShortCollection- Specified by:
toImmutablein interfaceMutableShortList- Specified by:
toImmutablein interfaceShortList- Overrides:
toImmutablein classAbstractSynchronizedShortCollection
-
newEmpty
Description copied from interface:MutableShortCollectionCreates a new empty mutable version of the same collection type.- Specified by:
newEmptyin interfaceMutableShortCollection- Specified by:
newEmptyin interfaceMutableShortList- Since:
- 9.2.
-
reverseThis
- Specified by:
reverseThisin interfaceMutableShortList
-
toReversed
- Specified by:
toReversedin interfaceMutableShortList- Specified by:
toReversedin interfaceReversibleShortIterable- Specified by:
toReversedin interfaceShortList
-
asReversed
- Specified by:
asReversedin interfaceReversibleShortIterable
-
forEachInBoth
Description copied from interface:ShortListThis method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBothin interfaceShortList
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedShortIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoWithIndexin interfaceOrderedShortIterable- Specified by:
injectIntoWithIndexin interfaceReversibleShortIterable
-
distinct
- Specified by:
distinctin interfaceMutableShortList- Specified by:
distinctin interfaceReversibleShortIterable- Specified by:
distinctin interfaceShortList- Since:
- 6.0.
-
subList
- Specified by:
subListin interfaceMutableShortList- Specified by:
subListin interfaceShortList- See Also:
-
zipShort
Description copied from interface:MutableShortListReturns aMutableListformed from thisMutableShortListand anotherShortListby combining corresponding elements in pairs. If one of the twoShortLists is longer than the other, its remaining elements are ignored.- Specified by:
zipShortin interfaceMutableShortList- Specified by:
zipShortin interfaceShortList- Since:
- 9.1.
-
zip
Description copied from interface:MutableShortListReturns aMutableListformed from thisMutableShortListand aListIterableby combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.- Specified by:
zipin interfaceMutableShortList- Specified by:
zipin interfaceShortList- Since:
- 9.1.
-
selectWithIndex
Returns a new MutableShortList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceMutableShortList- Specified by:
selectWithIndexin interfaceOrderedShortIterable- Specified by:
selectWithIndexin interfaceReversibleShortIterable- Specified by:
selectWithIndexin interfaceShortList- Since:
- 11.1.
-
selectWithIndex
Returns a new MutableShortCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedShortIterable- Since:
- 11.1.
-
rejectWithIndex
Returns a new MutableShortList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceMutableShortList- Specified by:
rejectWithIndexin interfaceOrderedShortIterable- Specified by:
rejectWithIndexin interfaceReversibleShortIterable- Specified by:
rejectWithIndexin interfaceShortList- Since:
- 11.1.
-
rejectWithIndex
Returns a new MutableShortCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedShortIterable- Since:
- 11.1.
-
collectWithIndex
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceMutableShortList- Specified by:
collectWithIndexin interfaceOrderedShortIterable- Specified by:
collectWithIndexin interfaceReversibleShortIterable- Specified by:
collectWithIndexin interfaceShortList- Since:
- 9.1.
-
collectWithIndex
public <V, R extends Collection<V>> R collectWithIndex(ShortIntToObjectFunction<? extends V> function, R target) Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceOrderedShortIterable- Since:
- 9.1.
-
toStack
Description copied from interface:OrderedShortIterableConverts the collection to a ShortStack.- Specified by:
toStackin interfaceOrderedShortIterable
-