Class SynchronizedIntList
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedIntCollection
-
- org.eclipse.collections.impl.list.mutable.primitive.SynchronizedIntList
-
- All Implemented Interfaces:
Serializable
,MutableIntCollection
,IntIterable
,IntList
,MutableIntList
,OrderedIntIterable
,ReversibleIntIterable
,PrimitiveIterable
public class SynchronizedIntList extends AbstractSynchronizedIntCollection implements MutableIntList
A synchronized view of aMutableIntList
. 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:
MutableIntList.asSynchronized()
,MutableList.asSynchronized()
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedIntList(MutableIntList list)
SynchronizedIntList(MutableIntList list, Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAllAtIndex(int index, int... source)
boolean
addAllAtIndex(int index, IntIterable source)
void
addAtIndex(int index, int element)
LazyIntIterable
asLazy()
LazyIntIterable
asReversed()
MutableIntList
asSynchronized()
MutableIntList
asUnmodifiable()
int
binarySearch(int value)
MutableList<Integer>
boxed()
<V> MutableList<V>
collect(IntToObjectFunction<? extends V> function)
<V> MutableList<V>
collectWithIndex(IntIntToObjectFunction<? 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(IntIntToObjectFunction<? 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.MutableIntList
distinct()
long
dotProduct(IntList list)
boolean
equals(Object otherList)
void
forEachInBoth(IntList other, IntIntProcedure procedure)
void
forEachWithIndex(IntIntProcedure procedure)
int
get(int index)
int
getFirst()
int
getLast()
int
hashCode()
int
indexOf(int value)
<T> T
injectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)
int
lastIndexOf(int value)
MutableIntList
newEmpty()
MutableIntList
reject(IntPredicate predicate)
MutableIntList
rejectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableIntCollection>
RrejectWithIndex(IntIntPredicate predicate, R target)
Returns a new MutableIntCollection excluding all elements with corresponding indexes matching the specified predicate.int
removeAtIndex(int index)
MutableIntList
reverseThis()
MutableIntList
select(IntPredicate predicate)
MutableIntList
selectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList including all elements with corresponding indexes matching the specified predicate.<R extends MutableIntCollection>
RselectWithIndex(IntIntPredicate predicate, R target)
Returns a new MutableIntCollection including all elements with corresponding indexes matching the specified predicate.int
set(int index, int element)
MutableIntList
shuffleThis()
MutableIntList
shuffleThis(Random rnd)
MutableIntList
sortThis()
MutableIntList
sortThis(IntComparator comparator)
<T> MutableIntList
sortThisBy(IntToObjectFunction<T> function)
<T> MutableIntList
sortThisBy(IntToObjectFunction<T> function, Comparator<? super T> comparator)
Spliterator.OfInt
spliterator()
This function needs to be synchronized manuallyMutableIntList
subList(int fromIndex, int toIndex)
ImmutableIntList
toImmutable()
MutableIntList
toReversed()
SynchronizedIntList
with(int element)
SynchronizedIntList
withAll(IntIterable elements)
SynchronizedIntList
without(int element)
SynchronizedIntList
withoutAll(IntIterable elements)
<T> MutableList<IntObjectPair<T>>
zip(Iterable<T> iterable)
MutableList<IntIntPair>
zipInt(IntIterable iterable)
-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedIntCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, injectInto, intIterator, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.IntIterable
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
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.IntList
primitiveParallelStream, primitiveStream
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableIntCollection
add, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableIntList
swap, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Constructor Detail
-
SynchronizedIntList
public SynchronizedIntList(MutableIntList list)
-
SynchronizedIntList
public SynchronizedIntList(MutableIntList list, Object newLock)
-
-
Method Detail
-
getFirst
public int getFirst()
- Specified by:
getFirst
in interfaceOrderedIntIterable
-
getLast
public int getLast()
- Specified by:
getLast
in interfaceReversibleIntIterable
-
indexOf
public int indexOf(int value)
- Specified by:
indexOf
in interfaceOrderedIntIterable
-
lastIndexOf
public int lastIndexOf(int value)
- Specified by:
lastIndexOf
in interfaceIntList
-
addAtIndex
public void addAtIndex(int index, int element)
- Specified by:
addAtIndex
in interfaceMutableIntList
-
addAllAtIndex
public boolean addAllAtIndex(int index, int... source)
- Specified by:
addAllAtIndex
in interfaceMutableIntList
-
addAllAtIndex
public boolean addAllAtIndex(int index, IntIterable source)
- Specified by:
addAllAtIndex
in interfaceMutableIntList
-
removeAtIndex
public int removeAtIndex(int index)
- Specified by:
removeAtIndex
in interfaceMutableIntList
-
set
public int set(int index, int element)
- Specified by:
set
in interfaceMutableIntList
-
with
public SynchronizedIntList with(int element)
- Specified by:
with
in interfaceMutableIntCollection
- Specified by:
with
in interfaceMutableIntList
- Overrides:
with
in classAbstractSynchronizedIntCollection
-
without
public SynchronizedIntList without(int element)
- Specified by:
without
in interfaceMutableIntCollection
- Specified by:
without
in interfaceMutableIntList
- Overrides:
without
in classAbstractSynchronizedIntCollection
-
withAll
public SynchronizedIntList withAll(IntIterable elements)
- Specified by:
withAll
in interfaceMutableIntCollection
- Specified by:
withAll
in interfaceMutableIntList
- Overrides:
withAll
in classAbstractSynchronizedIntCollection
-
withoutAll
public SynchronizedIntList withoutAll(IntIterable elements)
- Specified by:
withoutAll
in interfaceMutableIntCollection
- Specified by:
withoutAll
in interfaceMutableIntList
- Overrides:
withoutAll
in classAbstractSynchronizedIntCollection
-
select
public MutableIntList select(IntPredicate predicate)
- Specified by:
select
in interfaceIntIterable
- Specified by:
select
in interfaceIntList
- Specified by:
select
in interfaceMutableIntCollection
- Specified by:
select
in interfaceMutableIntList
- Specified by:
select
in interfaceOrderedIntIterable
- Specified by:
select
in interfaceReversibleIntIterable
- Overrides:
select
in classAbstractSynchronizedIntCollection
-
boxed
public MutableList<Integer> boxed()
- Specified by:
boxed
in interfaceMutableIntList
-
reject
public MutableIntList reject(IntPredicate predicate)
- Specified by:
reject
in interfaceIntIterable
- Specified by:
reject
in interfaceIntList
- Specified by:
reject
in interfaceMutableIntCollection
- Specified by:
reject
in interfaceMutableIntList
- Specified by:
reject
in interfaceOrderedIntIterable
- Specified by:
reject
in interfaceReversibleIntIterable
- Overrides:
reject
in classAbstractSynchronizedIntCollection
-
collect
public <V> MutableList<V> collect(IntToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceIntIterable
- Specified by:
collect
in interfaceIntList
- Specified by:
collect
in interfaceMutableIntCollection
- Specified by:
collect
in interfaceMutableIntList
- Specified by:
collect
in interfaceOrderedIntIterable
- Specified by:
collect
in interfaceReversibleIntIterable
- Overrides:
collect
in classAbstractSynchronizedIntCollection
-
sortThis
public MutableIntList sortThis()
- Specified by:
sortThis
in interfaceMutableIntList
-
sortThis
public MutableIntList sortThis(IntComparator comparator)
- Specified by:
sortThis
in interfaceMutableIntList
-
sortThisBy
public <T> MutableIntList sortThisBy(IntToObjectFunction<T> function)
- Specified by:
sortThisBy
in interfaceMutableIntList
-
sortThisBy
public <T> MutableIntList sortThisBy(IntToObjectFunction<T> function, Comparator<? super T> comparator)
- Specified by:
sortThisBy
in interfaceMutableIntList
-
shuffleThis
public MutableIntList shuffleThis()
- Specified by:
shuffleThis
in interfaceMutableIntList
-
shuffleThis
public MutableIntList shuffleThis(Random rnd)
- Specified by:
shuffleThis
in interfaceMutableIntList
-
binarySearch
public int binarySearch(int value)
- Specified by:
binarySearch
in interfaceIntList
-
dotProduct
public long dotProduct(IntList list)
- Specified by:
dotProduct
in interfaceIntList
-
equals
public boolean equals(Object otherList)
-
hashCode
public int hashCode()
-
asLazy
public LazyIntIterable asLazy()
- Specified by:
asLazy
in interfaceIntIterable
- Overrides:
asLazy
in classAbstractSynchronizedIntCollection
-
asUnmodifiable
public MutableIntList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableIntCollection
- Specified by:
asUnmodifiable
in interfaceMutableIntList
- Overrides:
asUnmodifiable
in classAbstractSynchronizedIntCollection
-
asSynchronized
public MutableIntList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableIntCollection
- Specified by:
asSynchronized
in interfaceMutableIntList
- Overrides:
asSynchronized
in classAbstractSynchronizedIntCollection
-
toImmutable
public ImmutableIntList toImmutable()
- Specified by:
toImmutable
in interfaceIntList
- Specified by:
toImmutable
in interfaceMutableIntCollection
- Specified by:
toImmutable
in interfaceMutableIntList
- Overrides:
toImmutable
in classAbstractSynchronizedIntCollection
-
newEmpty
public MutableIntList newEmpty()
- Specified by:
newEmpty
in interfaceMutableIntCollection
- Specified by:
newEmpty
in interfaceMutableIntList
- Since:
- 9.2.
-
reverseThis
public MutableIntList reverseThis()
- Specified by:
reverseThis
in interfaceMutableIntList
-
toReversed
public MutableIntList toReversed()
- Specified by:
toReversed
in interfaceIntList
- Specified by:
toReversed
in interfaceMutableIntList
- Specified by:
toReversed
in interfaceReversibleIntIterable
-
asReversed
public LazyIntIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleIntIterable
-
forEachInBoth
public void forEachInBoth(IntList other, IntIntProcedure procedure)
- Specified by:
forEachInBoth
in interfaceIntList
-
forEachWithIndex
public void forEachWithIndex(IntIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedIntIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedIntIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleIntIterable
-
distinct
public MutableIntList distinct()
- Specified by:
distinct
in interfaceIntList
- Specified by:
distinct
in interfaceMutableIntList
- Specified by:
distinct
in interfaceReversibleIntIterable
- Since:
- 6.0.
-
subList
public MutableIntList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceIntList
- Specified by:
subList
in interfaceMutableIntList
-
zipInt
public MutableList<IntIntPair> zipInt(IntIterable iterable)
- Specified by:
zipInt
in interfaceIntList
- Specified by:
zipInt
in interfaceMutableIntList
- Since:
- 9.1.
-
zip
public <T> MutableList<IntObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zip
in interfaceIntList
- Specified by:
zip
in interfaceMutableIntList
- Since:
- 9.1.
-
selectWithIndex
public MutableIntList selectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceIntList
- Specified by:
selectWithIndex
in interfaceMutableIntList
- Specified by:
selectWithIndex
in interfaceOrderedIntIterable
- Specified by:
selectWithIndex
in interfaceReversibleIntIterable
- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableIntCollection> R selectWithIndex(IntIntPredicate predicate, R target)
Returns a new MutableIntCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceOrderedIntIterable
- Since:
- 11.1.
-
rejectWithIndex
public MutableIntList rejectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceIntList
- Specified by:
rejectWithIndex
in interfaceMutableIntList
- Specified by:
rejectWithIndex
in interfaceOrderedIntIterable
- Specified by:
rejectWithIndex
in interfaceReversibleIntIterable
- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableIntCollection> R rejectWithIndex(IntIntPredicate predicate, R target)
Returns a new MutableIntCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceOrderedIntIterable
- Since:
- 11.1.
-
collectWithIndex
public <V> MutableList<V> collectWithIndex(IntIntToObjectFunction<? 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 interfaceIntList
- Specified by:
collectWithIndex
in interfaceMutableIntList
- Specified by:
collectWithIndex
in interfaceOrderedIntIterable
- Specified by:
collectWithIndex
in interfaceReversibleIntIterable
- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(IntIntToObjectFunction<? 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 interfaceOrderedIntIterable
- Since:
- 9.1.
-
spliterator
public Spliterator.OfInt spliterator()
This function needs to be synchronized manually- Specified by:
spliterator
in interfaceIntList
-
-