Class SynchronizedShortList
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedShortCollection
-
- org.eclipse.collections.impl.list.mutable.primitive.SynchronizedShortList
-
- All Implemented Interfaces:
java.io.Serializable
,MutableShortCollection
,MutableShortList
,ShortList
,OrderedShortIterable
,ReversibleShortIterable
,PrimitiveIterable
,ShortIterable
public class SynchronizedShortList extends AbstractSynchronizedShortCollection implements MutableShortList
A synchronized view of aMutableShortList
. 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:
MutableShortList.asSynchronized()
,MutableList.asSynchronized()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedShortList(MutableShortList list)
SynchronizedShortList(MutableShortList list, java.lang.Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAllAtIndex(int index, short... source)
boolean
addAllAtIndex(int index, ShortIterable source)
void
addAtIndex(int index, short element)
LazyShortIterable
asLazy()
Returns a LazyShortIterable adapter wrapping the source ShortIterable.LazyShortIterable
asReversed()
MutableShortList
asSynchronized()
MutableShortList
asUnmodifiable()
int
binarySearch(short value)
<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 java.util.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.MutableShortList
distinct()
long
dotProduct(ShortList list)
boolean
equals(java.lang.Object otherList)
Follows the same general contract asList.equals(Object)
.void
forEachInBoth(ShortList other, ShortShortProcedure procedure)
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.void
forEachWithIndex(ShortIntProcedure procedure)
short
get(int index)
short
getFirst()
short
getLast()
private MutableShortList
getMutableShortList()
int
hashCode()
Follows the same general contract asList.hashCode()
.int
indexOf(short value)
<T> T
injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T,? extends T> function)
int
lastIndexOf(short value)
MutableShortList
newEmpty()
Creates a new empty mutable version of the same List type.MutableShortList
reject(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.MutableShortList
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.short
removeAtIndex(int index)
MutableShortList
reverseThis()
MutableShortList
select(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.MutableShortList
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.short
set(int index, short element)
MutableShortList
shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this).MutableShortList
shuffleThis(java.util.Random rnd)
Randomly permutes this list mutating its contents and returns the same list (this).MutableShortList
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).MutableShortList
sortThis(ShortComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableShortList
sortThisBy(ShortToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.<T> MutableShortList
sortThisBy(ShortToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.MutableShortList
subList(int fromIndex, int toIndex)
ImmutableShortList
toImmutable()
Returns an immutable copy of this list.MutableShortList
toReversed()
SynchronizedShortList
with(short element)
SynchronizedShortList
withAll(ShortIterable elements)
SynchronizedShortList
without(short element)
SynchronizedShortList
withoutAll(ShortIterable elements)
<T> MutableList<ShortObjectPair<T>>
zip(java.lang.Iterable<T> iterable)
Returns aMutableList
formed from thisMutableShortList
and aListIterable
by combining corresponding elements in pairs.MutableList<ShortShortPair>
zipShort(ShortIterable iterable)
Returns aMutableList
formed from thisMutableShortList
and anotherShortList
by combining corresponding elements in pairs.-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.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, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableShortCollection
add, addAll, addAll, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableShortList
swap, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Methods inherited from interface org.eclipse.collections.api.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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SynchronizedShortList
public SynchronizedShortList(MutableShortList list)
-
SynchronizedShortList
public SynchronizedShortList(MutableShortList list, java.lang.Object newLock)
-
-
Method Detail
-
getMutableShortList
private MutableShortList getMutableShortList()
-
getFirst
public short getFirst()
- Specified by:
getFirst
in interfaceOrderedShortIterable
-
getLast
public short getLast()
- Specified by:
getLast
in interfaceReversibleShortIterable
-
indexOf
public int indexOf(short value)
- Specified by:
indexOf
in interfaceOrderedShortIterable
-
lastIndexOf
public int lastIndexOf(short value)
- Specified by:
lastIndexOf
in interfaceShortList
-
addAtIndex
public void addAtIndex(int index, short element)
- Specified by:
addAtIndex
in interfaceMutableShortList
-
addAllAtIndex
public boolean addAllAtIndex(int index, short... source)
- Specified by:
addAllAtIndex
in interfaceMutableShortList
-
addAllAtIndex
public boolean addAllAtIndex(int index, ShortIterable source)
- Specified by:
addAllAtIndex
in interfaceMutableShortList
-
removeAtIndex
public short removeAtIndex(int index)
- Specified by:
removeAtIndex
in interfaceMutableShortList
-
set
public short set(int index, short element)
- Specified by:
set
in interfaceMutableShortList
-
with
public SynchronizedShortList with(short element)
- Specified by:
with
in interfaceMutableShortCollection
- Specified by:
with
in interfaceMutableShortList
- Overrides:
with
in classAbstractSynchronizedShortCollection
-
without
public SynchronizedShortList without(short element)
- Specified by:
without
in interfaceMutableShortCollection
- Specified by:
without
in interfaceMutableShortList
- Overrides:
without
in classAbstractSynchronizedShortCollection
-
withAll
public SynchronizedShortList withAll(ShortIterable elements)
- Specified by:
withAll
in interfaceMutableShortCollection
- Specified by:
withAll
in interfaceMutableShortList
- Overrides:
withAll
in classAbstractSynchronizedShortCollection
-
withoutAll
public SynchronizedShortList withoutAll(ShortIterable elements)
- Specified by:
withoutAll
in interfaceMutableShortCollection
- Specified by:
withoutAll
in interfaceMutableShortList
- Overrides:
withoutAll
in classAbstractSynchronizedShortCollection
-
select
public MutableShortList select(ShortPredicate predicate)
Description copied from interface:ShortIterable
Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.- Specified by:
select
in interfaceMutableShortCollection
- Specified by:
select
in interfaceMutableShortList
- Specified by:
select
in interfaceOrderedShortIterable
- Specified by:
select
in interfaceReversibleShortIterable
- Specified by:
select
in interfaceShortIterable
- Specified by:
select
in interfaceShortList
- Overrides:
select
in classAbstractSynchronizedShortCollection
-
reject
public MutableShortList reject(ShortPredicate predicate)
Description copied from interface:ShortIterable
Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.- Specified by:
reject
in interfaceMutableShortCollection
- Specified by:
reject
in interfaceMutableShortList
- Specified by:
reject
in interfaceOrderedShortIterable
- Specified by:
reject
in interfaceReversibleShortIterable
- Specified by:
reject
in interfaceShortIterable
- Specified by:
reject
in interfaceShortList
- Overrides:
reject
in classAbstractSynchronizedShortCollection
-
collect
public <V> MutableList<V> collect(ShortToObjectFunction<? extends V> function)
Description copied from interface:ShortIterable
Returns 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:
collect
in interfaceMutableShortCollection
- Specified by:
collect
in interfaceMutableShortList
- Specified by:
collect
in interfaceOrderedShortIterable
- Specified by:
collect
in interfaceReversibleShortIterable
- Specified by:
collect
in interfaceShortIterable
- Specified by:
collect
in interfaceShortList
- Overrides:
collect
in classAbstractSynchronizedShortCollection
-
sortThis
public MutableShortList sortThis()
Description copied from interface:MutableShortList
Sorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThis
in interfaceMutableShortList
-
sortThis
public MutableShortList sortThis(ShortComparator comparator)
Description copied from interface:MutableShortList
Sorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThis
in interfaceMutableShortList
-
sortThisBy
public <T> MutableShortList sortThisBy(ShortToObjectFunction<T> function)
Description copied from interface:MutableShortList
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.- Specified by:
sortThisBy
in interfaceMutableShortList
-
sortThisBy
public <T> MutableShortList sortThisBy(ShortToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Description copied from interface:MutableShortList
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.- Specified by:
sortThisBy
in interfaceMutableShortList
-
shuffleThis
public MutableShortList shuffleThis()
Description copied from interface:MutableShortList
Randomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Random
as the source of randomness.- Specified by:
shuffleThis
in interfaceMutableShortList
-
shuffleThis
public MutableShortList shuffleThis(java.util.Random rnd)
Description copied from interface:MutableShortList
Randomly 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:
shuffleThis
in interfaceMutableShortList
-
binarySearch
public int binarySearch(short value)
- Specified by:
binarySearch
in interfaceShortList
-
dotProduct
public long dotProduct(ShortList list)
- Specified by:
dotProduct
in interfaceShortList
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:ShortList
Follows the same general contract asList.equals(Object)
.
-
hashCode
public int hashCode()
Description copied from interface:ShortList
Follows the same general contract asList.hashCode()
.
-
asLazy
public LazyShortIterable asLazy()
Description copied from interface:ShortIterable
Returns a LazyShortIterable adapter wrapping the source ShortIterable.- Specified by:
asLazy
in interfaceShortIterable
- Overrides:
asLazy
in classAbstractSynchronizedShortCollection
-
asUnmodifiable
public MutableShortList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableShortCollection
- Specified by:
asUnmodifiable
in interfaceMutableShortList
- Overrides:
asUnmodifiable
in classAbstractSynchronizedShortCollection
-
asSynchronized
public MutableShortList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableShortCollection
- Specified by:
asSynchronized
in interfaceMutableShortList
- Overrides:
asSynchronized
in classAbstractSynchronizedShortCollection
-
toImmutable
public ImmutableShortList toImmutable()
Description copied from interface:MutableShortList
Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceMutableShortCollection
- Specified by:
toImmutable
in interfaceMutableShortList
- Specified by:
toImmutable
in interfaceShortList
- Overrides:
toImmutable
in classAbstractSynchronizedShortCollection
-
newEmpty
public MutableShortList newEmpty()
Description copied from interface:MutableShortList
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableShortCollection
- Specified by:
newEmpty
in interfaceMutableShortList
- Since:
- 9.2.
-
reverseThis
public MutableShortList reverseThis()
- Specified by:
reverseThis
in interfaceMutableShortList
-
toReversed
public MutableShortList toReversed()
- Specified by:
toReversed
in interfaceMutableShortList
- Specified by:
toReversed
in interfaceReversibleShortIterable
- Specified by:
toReversed
in interfaceShortList
-
asReversed
public LazyShortIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleShortIterable
-
forEachInBoth
public void forEachInBoth(ShortList other, ShortShortProcedure procedure)
Description copied from interface:ShortList
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBoth
in interfaceShortList
-
forEachWithIndex
public void forEachWithIndex(ShortIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedShortIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedShortIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleShortIterable
-
distinct
public MutableShortList distinct()
- Specified by:
distinct
in interfaceMutableShortList
- Specified by:
distinct
in interfaceReversibleShortIterable
- Specified by:
distinct
in interfaceShortList
- Since:
- 6.0.
-
subList
public MutableShortList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceMutableShortList
- Specified by:
subList
in interfaceShortList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipShort
public MutableList<ShortShortPair> zipShort(ShortIterable iterable)
Description copied from interface:MutableShortList
Returns aMutableList
formed from thisMutableShortList
and anotherShortList
by combining corresponding elements in pairs. If one of the twoShortList
s is longer than the other, its remaining elements are ignored.- Specified by:
zipShort
in interfaceMutableShortList
- Specified by:
zipShort
in interfaceShortList
- Since:
- 9.1.
-
zip
public <T> MutableList<ShortObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:MutableShortList
Returns aMutableList
formed from thisMutableShortList
and aListIterable
by combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.- Specified by:
zip
in interfaceMutableShortList
- Specified by:
zip
in interfaceShortList
- Since:
- 9.1.
-
selectWithIndex
public MutableShortList selectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceMutableShortList
- Specified by:
selectWithIndex
in interfaceOrderedShortIterable
- Specified by:
selectWithIndex
in interfaceReversibleShortIterable
- Specified by:
selectWithIndex
in interfaceShortList
- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableShortCollection> R selectWithIndex(ShortIntPredicate predicate, R target)
Returns a new MutableShortCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceOrderedShortIterable
- Since:
- 11.1.
-
rejectWithIndex
public MutableShortList rejectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceMutableShortList
- Specified by:
rejectWithIndex
in interfaceOrderedShortIterable
- Specified by:
rejectWithIndex
in interfaceReversibleShortIterable
- Specified by:
rejectWithIndex
in interfaceShortList
- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableShortCollection> R rejectWithIndex(ShortIntPredicate predicate, R target)
Returns a new MutableShortCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceOrderedShortIterable
- Since:
- 11.1.
-
collectWithIndex
public <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.- Specified by:
collectWithIndex
in interfaceMutableShortList
- Specified by:
collectWithIndex
in interfaceOrderedShortIterable
- Specified by:
collectWithIndex
in interfaceReversibleShortIterable
- Specified by:
collectWithIndex
in interfaceShortList
- Since:
- 9.1.
-
collectWithIndex
public <V,R extends java.util.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:
collectWithIndex
in interfaceOrderedShortIterable
- Since:
- 9.1.
-
-