Class SynchronizedIntList
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedIntCollection
-
- org.eclipse.collections.impl.list.mutable.primitive.SynchronizedIntList
-
- All Implemented Interfaces:
java.io.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
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedIntList(MutableIntList list)SynchronizedIntList(MutableIntList list, java.lang.Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAllAtIndex(int index, int... source)booleanaddAllAtIndex(int index, IntIterable source)voidaddAtIndex(int index, int element)LazyIntIterableasLazy()Returns a LazyIntIterable adapter wrapping the source IntIterable.LazyIntIterableasReversed()MutableIntListasSynchronized()MutableIntListasUnmodifiable()intbinarySearch(int value)MutableList<java.lang.Integer>boxed()<V> MutableList<V>collect(IntToObjectFunction<? 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(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 java.util.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.MutableIntListdistinct()longdotProduct(IntList list)booleanequals(java.lang.Object otherList)Follows the same general contract asList.equals(Object).voidforEachInBoth(IntList other, IntIntProcedure procedure)This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.voidforEachWithIndex(IntIntProcedure procedure)intget(int index)intgetFirst()intgetLast()private MutableIntListgetMutableIntList()inthashCode()Follows the same general contract asList.hashCode().intindexOf(int value)<T> TinjectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(int value)MutableIntListnewEmpty()Creates a new empty mutable version of the same List type.MutableIntListreject(IntPredicate predicate)Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.MutableIntListrejectWithIndex(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.intremoveAtIndex(int index)MutableIntListreverseThis()MutableIntListselect(IntPredicate predicate)Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.MutableIntListselectWithIndex(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.intset(int index, int element)MutableIntListshuffleThis()Randomly permutes this list mutating its contents and returns the same list (this).MutableIntListshuffleThis(java.util.Random rnd)Randomly permutes this list mutating its contents and returns the same list (this).MutableIntListsortThis()Sorts this list mutating its contents and returns the same mutable list (this).MutableIntListsortThis(IntComparator comparator)Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableIntListsortThisBy(IntToObjectFunction<T> function)Sorts the internal data structure of this list based on the natural order of the key returned byfunction.<T> MutableIntListsortThisBy(IntToObjectFunction<T> function, java.util.Comparator<? super T> comparator)Sorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.java.util.Spliterator.OfIntspliterator()This function needs to be synchronized manuallyMutableIntListsubList(int fromIndex, int toIndex)ImmutableIntListtoImmutable()Returns an immutable copy of this list.MutableIntListtoReversed()MutableIntStacktoStack()Converts the collection to a IntStack.SynchronizedIntListwith(int element)SynchronizedIntListwithAll(IntIterable elements)SynchronizedIntListwithout(int element)SynchronizedIntListwithoutAll(IntIterable elements)<T> MutableList<IntObjectPair<T>>zip(java.lang.Iterable<T> iterable)Returns aMutableListformed from thisMutableIntListand aListIterableby combining corresponding elements in pairs.MutableList<IntIntPair>zipInt(IntIterable iterable)Returns aMutableListformed from thisMutableIntListand anotherIntListby combining corresponding elements in pairs.-
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, getIntCollection, getLock, 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SynchronizedIntList
public SynchronizedIntList(MutableIntList list)
-
SynchronizedIntList
public SynchronizedIntList(MutableIntList list, java.lang.Object newLock)
-
-
Method Detail
-
getMutableIntList
private MutableIntList getMutableIntList()
-
getFirst
public int getFirst()
- Specified by:
getFirstin interfaceOrderedIntIterable
-
getLast
public int getLast()
- Specified by:
getLastin interfaceReversibleIntIterable
-
indexOf
public int indexOf(int value)
- Specified by:
indexOfin interfaceOrderedIntIterable
-
lastIndexOf
public int lastIndexOf(int value)
- Specified by:
lastIndexOfin interfaceIntList
-
addAtIndex
public void addAtIndex(int index, int element)- Specified by:
addAtIndexin interfaceMutableIntList
-
addAllAtIndex
public boolean addAllAtIndex(int index, int... source)- Specified by:
addAllAtIndexin interfaceMutableIntList
-
addAllAtIndex
public boolean addAllAtIndex(int index, IntIterable source)- Specified by:
addAllAtIndexin interfaceMutableIntList
-
removeAtIndex
public int removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableIntList
-
set
public int set(int index, int element)- Specified by:
setin interfaceMutableIntList
-
with
public SynchronizedIntList with(int element)
- Specified by:
within interfaceMutableIntCollection- Specified by:
within interfaceMutableIntList- Overrides:
within classAbstractSynchronizedIntCollection
-
without
public SynchronizedIntList without(int element)
- Specified by:
withoutin interfaceMutableIntCollection- Specified by:
withoutin interfaceMutableIntList- Overrides:
withoutin classAbstractSynchronizedIntCollection
-
withAll
public SynchronizedIntList withAll(IntIterable elements)
- Specified by:
withAllin interfaceMutableIntCollection- Specified by:
withAllin interfaceMutableIntList- Overrides:
withAllin classAbstractSynchronizedIntCollection
-
withoutAll
public SynchronizedIntList withoutAll(IntIterable elements)
- Specified by:
withoutAllin interfaceMutableIntCollection- Specified by:
withoutAllin interfaceMutableIntList- Overrides:
withoutAllin classAbstractSynchronizedIntCollection
-
select
public MutableIntList select(IntPredicate predicate)
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceIntList- Specified by:
selectin interfaceMutableIntCollection- Specified by:
selectin interfaceMutableIntList- Specified by:
selectin interfaceOrderedIntIterable- Specified by:
selectin interfaceReversibleIntIterable- Overrides:
selectin classAbstractSynchronizedIntCollection
-
boxed
public MutableList<java.lang.Integer> boxed()
- Specified by:
boxedin interfaceMutableIntList
-
reject
public MutableIntList reject(IntPredicate predicate)
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceIntList- Specified by:
rejectin interfaceMutableIntCollection- Specified by:
rejectin interfaceMutableIntList- Specified by:
rejectin interfaceOrderedIntIterable- Specified by:
rejectin interfaceReversibleIntIterable- Overrides:
rejectin classAbstractSynchronizedIntCollection
-
collect
public <V> MutableList<V> collect(IntToObjectFunction<? extends V> function)
Description copied from interface:IntIterableReturns 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 interfaceIntIterable- Specified by:
collectin interfaceIntList- Specified by:
collectin interfaceMutableIntCollection- Specified by:
collectin interfaceMutableIntList- Specified by:
collectin interfaceOrderedIntIterable- Specified by:
collectin interfaceReversibleIntIterable- Overrides:
collectin classAbstractSynchronizedIntCollection
-
sortThis
public MutableIntList sortThis()
Description copied from interface:MutableIntListSorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThisin interfaceMutableIntList
-
sortThis
public MutableIntList sortThis(IntComparator comparator)
Description copied from interface:MutableIntListSorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThisin interfaceMutableIntList
-
sortThisBy
public <T> MutableIntList sortThisBy(IntToObjectFunction<T> function)
Description copied from interface:MutableIntListSorts the internal data structure of this list based on the natural order of the key returned byfunction.- Specified by:
sortThisByin interfaceMutableIntList
-
sortThisBy
public <T> MutableIntList sortThisBy(IntToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Description copied from interface:MutableIntListSorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.- Specified by:
sortThisByin interfaceMutableIntList
-
shuffleThis
public MutableIntList shuffleThis()
Description copied from interface:MutableIntListRandomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Randomas the source of randomness.- Specified by:
shuffleThisin interfaceMutableIntList
-
shuffleThis
public MutableIntList shuffleThis(java.util.Random rnd)
Description copied from interface:MutableIntListRandomly 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 interfaceMutableIntList
-
binarySearch
public int binarySearch(int value)
- Specified by:
binarySearchin interfaceIntList
-
dotProduct
public long dotProduct(IntList list)
- Specified by:
dotProductin interfaceIntList
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:IntListFollows the same general contract asList.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:IntListFollows the same general contract asList.hashCode().
-
asLazy
public LazyIntIterable asLazy()
Description copied from interface:IntIterableReturns a LazyIntIterable adapter wrapping the source IntIterable.- Specified by:
asLazyin interfaceIntIterable- Overrides:
asLazyin classAbstractSynchronizedIntCollection
-
asUnmodifiable
public MutableIntList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableIntCollection- Specified by:
asUnmodifiablein interfaceMutableIntList- Overrides:
asUnmodifiablein classAbstractSynchronizedIntCollection
-
asSynchronized
public MutableIntList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableIntCollection- Specified by:
asSynchronizedin interfaceMutableIntList- Overrides:
asSynchronizedin classAbstractSynchronizedIntCollection
-
toImmutable
public ImmutableIntList toImmutable()
Description copied from interface:MutableIntListReturns an immutable copy of this list.- Specified by:
toImmutablein interfaceIntList- Specified by:
toImmutablein interfaceMutableIntCollection- Specified by:
toImmutablein interfaceMutableIntList- Overrides:
toImmutablein classAbstractSynchronizedIntCollection
-
newEmpty
public MutableIntList newEmpty()
Description copied from interface:MutableIntListCreates a new empty mutable version of the same List type.- Specified by:
newEmptyin interfaceMutableIntCollection- Specified by:
newEmptyin interfaceMutableIntList- Since:
- 9.2.
-
reverseThis
public MutableIntList reverseThis()
- Specified by:
reverseThisin interfaceMutableIntList
-
toReversed
public MutableIntList toReversed()
- Specified by:
toReversedin interfaceIntList- Specified by:
toReversedin interfaceMutableIntList- Specified by:
toReversedin interfaceReversibleIntIterable
-
asReversed
public LazyIntIterable asReversed()
- Specified by:
asReversedin interfaceReversibleIntIterable
-
forEachInBoth
public void forEachInBoth(IntList other, IntIntProcedure procedure)
Description copied from interface:IntListThis method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBothin interfaceIntList
-
forEachWithIndex
public void forEachWithIndex(IntIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedIntIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedIntIterable- Specified by:
injectIntoWithIndexin interfaceReversibleIntIterable
-
distinct
public MutableIntList distinct()
- Specified by:
distinctin interfaceIntList- Specified by:
distinctin interfaceMutableIntList- Specified by:
distinctin interfaceReversibleIntIterable- Since:
- 6.0.
-
subList
public MutableIntList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceIntList- Specified by:
subListin interfaceMutableIntList- See Also:
List.subList(int fromIndex, int toIndex)
-
zipInt
public MutableList<IntIntPair> zipInt(IntIterable iterable)
Description copied from interface:MutableIntListReturns aMutableListformed from thisMutableIntListand anotherIntListby combining corresponding elements in pairs. If one of the twoIntLists is longer than the other, its remaining elements are ignored.- Specified by:
zipIntin interfaceIntList- Specified by:
zipIntin interfaceMutableIntList- Since:
- 9.1.
-
zip
public <T> MutableList<IntObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:MutableIntListReturns aMutableListformed from thisMutableIntListand 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 interfaceIntList- Specified by:
zipin 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:
selectWithIndexin interfaceIntList- Specified by:
selectWithIndexin interfaceMutableIntList- Specified by:
selectWithIndexin interfaceOrderedIntIterable- Specified by:
selectWithIndexin 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:
selectWithIndexin 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:
rejectWithIndexin interfaceIntList- Specified by:
rejectWithIndexin interfaceMutableIntList- Specified by:
rejectWithIndexin interfaceOrderedIntIterable- Specified by:
rejectWithIndexin 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:
rejectWithIndexin 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:
collectWithIndexin interfaceIntList- Specified by:
collectWithIndexin interfaceMutableIntList- Specified by:
collectWithIndexin interfaceOrderedIntIterable- Specified by:
collectWithIndexin interfaceReversibleIntIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends java.util.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:
collectWithIndexin interfaceOrderedIntIterable- Since:
- 9.1.
-
toStack
public MutableIntStack toStack()
Description copied from interface:OrderedIntIterableConverts the collection to a IntStack.- Specified by:
toStackin interfaceOrderedIntIterable
-
spliterator
public java.util.Spliterator.OfInt spliterator()
This function needs to be synchronized manually- Specified by:
spliteratorin interfaceIntList
-
-