Class SynchronizedLongList
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection
org.eclipse.collections.impl.list.mutable.primitive.SynchronizedLongList
- All Implemented Interfaces:
Serializable, MutableLongCollection, LongList, MutableLongList, LongIterable, OrderedLongIterable, ReversibleLongIterable, PrimitiveIterable
public class SynchronizedLongList
extends AbstractSynchronizedLongCollection
implements MutableLongList
A synchronized view of a
MutableLongList. 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, long... source) booleanaddAllAtIndex(int index, LongIterable source) voidaddAtIndex(int index, long element) asLazy()Returns a LazyLongIterable adapter wrapping the source LongIterable.intbinarySearch(long value) boxed()<V> MutableList<V> collect(LongToObjectFunction<? 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(LongIntToObjectFunction<? 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(LongIntToObjectFunction<? 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(LongList list) booleanFollows the same general contract asList.equals(Object).voidforEachInBoth(LongList other, LongLongProcedure procedure) This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.voidforEachWithIndex(LongIntProcedure procedure) longget(int index) longgetFirst()longgetLast()private MutableLongListinthashCode()Follows the same general contract asList.hashCode().intindexOf(long value) <T> TinjectIntoWithIndex(T injectedValue, ObjectLongIntToObjectFunction<? super T, ? extends T> function) intlastIndexOf(long value) newEmpty()Creates a new empty mutable version of the same collection type.reject(LongPredicate predicate) Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.rejectWithIndex(LongIntPredicate predicate) Returns a new MutableLongList excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableLongCollection>
RrejectWithIndex(LongIntPredicate predicate, R target) Returns a new MutableLongCollection excluding all elements with corresponding indexes matching the specified predicate.longremoveAtIndex(int index) select(LongPredicate predicate) Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.selectWithIndex(LongIntPredicate predicate) Returns a new MutableLongList including all elements with corresponding indexes matching the specified predicate.<R extends MutableLongCollection>
RselectWithIndex(LongIntPredicate predicate, R target) Returns a new MutableLongCollection including all elements with corresponding indexes matching the specified predicate.longset(int index, long 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(LongComparator comparator) Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableLongListsortThisBy(LongToObjectFunction<T> function) Sorts the internal data structure of this list based on the natural order of the key returned byfunction.<T> MutableLongListsortThisBy(LongToObjectFunction<T> function, Comparator<? super T> comparator) Sorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.This function needs to be synchronized manuallysubList(int fromIndex, int toIndex) Returns an immutable copy of this list.toStack()Converts the collection to a LongStack.with(long element) withAll(LongIterable elements) without(long element) withoutAll(LongIterable elements) <T> MutableList<LongObjectPair<T>> Returns aMutableListformed from thisMutableLongListand aListIterableby combining corresponding elements in pairs.zipLong(LongIterable iterable) Returns aMutableListformed from thisMutableLongListand anotherLongListby combining corresponding elements in pairs.Methods inherited from class AbstractSynchronizedLongCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getLock, getLongCollection, injectInto, isEmpty, longIterator, 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, toStringMethods inherited from interface LongIterable
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, toSortedListByMethods inherited from interface LongList
primitiveParallelStream, primitiveStreamMethods inherited from interface MutableLongCollection
add, addAll, addAll, clear, longIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAllMethods inherited from interface MutableLongList
swap, tapMethods inherited from interface PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
SynchronizedLongList
-
SynchronizedLongList
-
-
Method Details
-
getMutableLongList
-
get
-
getFirst
public long getFirst()- Specified by:
getFirstin interfaceOrderedLongIterable
-
getLast
public long getLast()- Specified by:
getLastin interfaceReversibleLongIterable
-
indexOf
public int indexOf(long value) - Specified by:
indexOfin interfaceOrderedLongIterable
-
lastIndexOf
public int lastIndexOf(long value) - Specified by:
lastIndexOfin interfaceLongList
-
addAtIndex
public void addAtIndex(int index, long element) - Specified by:
addAtIndexin interfaceMutableLongList
-
addAllAtIndex
public boolean addAllAtIndex(int index, long... source) - Specified by:
addAllAtIndexin interfaceMutableLongList
-
addAllAtIndex
- Specified by:
addAllAtIndexin interfaceMutableLongList
-
removeAtIndex
public long removeAtIndex(int index) - Specified by:
removeAtIndexin interfaceMutableLongList
-
set
public long set(int index, long element) - Specified by:
setin interfaceMutableLongList
-
with
- Specified by:
within interfaceMutableLongCollection- Specified by:
within interfaceMutableLongList- Overrides:
within classAbstractSynchronizedLongCollection
-
without
- Specified by:
withoutin interfaceMutableLongCollection- Specified by:
withoutin interfaceMutableLongList- Overrides:
withoutin classAbstractSynchronizedLongCollection
-
withAll
- Specified by:
withAllin interfaceMutableLongCollection- Specified by:
withAllin interfaceMutableLongList- Overrides:
withAllin classAbstractSynchronizedLongCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableLongCollection- Specified by:
withoutAllin interfaceMutableLongList- Overrides:
withoutAllin classAbstractSynchronizedLongCollection
-
select
Description copied from interface:LongIterableReturns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
selectin interfaceLongIterable- Specified by:
selectin interfaceLongList- Specified by:
selectin interfaceMutableLongCollection- Specified by:
selectin interfaceMutableLongList- Specified by:
selectin interfaceOrderedLongIterable- Specified by:
selectin interfaceReversibleLongIterable- Overrides:
selectin classAbstractSynchronizedLongCollection
-
boxed
- Specified by:
boxedin interfaceMutableLongList
-
reject
Description copied from interface:LongIterableReturns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
rejectin interfaceLongIterable- Specified by:
rejectin interfaceLongList- Specified by:
rejectin interfaceMutableLongCollection- Specified by:
rejectin interfaceMutableLongList- Specified by:
rejectin interfaceOrderedLongIterable- Specified by:
rejectin interfaceReversibleLongIterable- Overrides:
rejectin classAbstractSynchronizedLongCollection
-
collect
Description copied from interface:LongIterableReturns 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 interfaceLongIterable- Specified by:
collectin interfaceLongList- Specified by:
collectin interfaceMutableLongCollection- Specified by:
collectin interfaceMutableLongList- Specified by:
collectin interfaceOrderedLongIterable- Specified by:
collectin interfaceReversibleLongIterable- Overrides:
collectin classAbstractSynchronizedLongCollection
-
sortThis
Description copied from interface:MutableLongListSorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThisin interfaceMutableLongList
-
sortThis
Description copied from interface:MutableLongListSorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThisin interfaceMutableLongList
-
sortThisBy
Description copied from interface:MutableLongListSorts the internal data structure of this list based on the natural order of the key returned byfunction.- Specified by:
sortThisByin interfaceMutableLongList
-
sortThisBy
public <T> MutableLongList sortThisBy(LongToObjectFunction<T> function, Comparator<? super T> comparator) Description copied from interface:MutableLongListSorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.- Specified by:
sortThisByin interfaceMutableLongList
-
shuffleThis
Description copied from interface:MutableLongListRandomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Randomas the source of randomness.- Specified by:
shuffleThisin interfaceMutableLongList
-
shuffleThis
Description copied from interface:MutableLongListRandomly 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 interfaceMutableLongList
-
binarySearch
public int binarySearch(long value) - Specified by:
binarySearchin interfaceLongList
-
dotProduct
- Specified by:
dotProductin interfaceLongList
-
equals
-
hashCode
-
asLazy
Description copied from interface:LongIterableReturns a LazyLongIterable adapter wrapping the source LongIterable.- Specified by:
asLazyin interfaceLongIterable- Overrides:
asLazyin classAbstractSynchronizedLongCollection
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableLongCollection- Specified by:
asUnmodifiablein interfaceMutableLongList- Overrides:
asUnmodifiablein classAbstractSynchronizedLongCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableLongCollection- Specified by:
asSynchronizedin interfaceMutableLongList- Overrides:
asSynchronizedin classAbstractSynchronizedLongCollection
-
toImmutable
Description copied from interface:MutableLongListReturns an immutable copy of this list.- Specified by:
toImmutablein interfaceLongList- Specified by:
toImmutablein interfaceMutableLongCollection- Specified by:
toImmutablein interfaceMutableLongList- Overrides:
toImmutablein classAbstractSynchronizedLongCollection
-
newEmpty
Description copied from interface:MutableLongCollectionCreates a new empty mutable version of the same collection type.- Specified by:
newEmptyin interfaceMutableLongCollection- Specified by:
newEmptyin interfaceMutableLongList- Since:
- 9.2.
-
reverseThis
- Specified by:
reverseThisin interfaceMutableLongList
-
toReversed
- Specified by:
toReversedin interfaceLongList- Specified by:
toReversedin interfaceMutableLongList- Specified by:
toReversedin interfaceReversibleLongIterable
-
asReversed
- Specified by:
asReversedin interfaceReversibleLongIterable
-
forEachInBoth
Description copied from interface:LongListThis method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBothin interfaceLongList
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedLongIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectLongIntToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoWithIndexin interfaceOrderedLongIterable- Specified by:
injectIntoWithIndexin interfaceReversibleLongIterable
-
distinct
- Specified by:
distinctin interfaceLongList- Specified by:
distinctin interfaceMutableLongList- Specified by:
distinctin interfaceReversibleLongIterable- Since:
- 6.0.
-
subList
- Specified by:
subListin interfaceLongList- Specified by:
subListin interfaceMutableLongList- See Also:
-
zipLong
Description copied from interface:MutableLongListReturns aMutableListformed from thisMutableLongListand anotherLongListby combining corresponding elements in pairs. If one of the twoLongLists is longer than the other, its remaining elements are ignored.- Specified by:
zipLongin interfaceLongList- Specified by:
zipLongin interfaceMutableLongList- Since:
- 9.1.
-
zip
Description copied from interface:MutableLongListReturns aMutableListformed from thisMutableLongListand 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 interfaceLongList- Specified by:
zipin interfaceMutableLongList- Since:
- 9.1.
-
selectWithIndex
Returns a new MutableLongList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceLongList- Specified by:
selectWithIndexin interfaceMutableLongList- Specified by:
selectWithIndexin interfaceOrderedLongIterable- Specified by:
selectWithIndexin interfaceReversibleLongIterable- Since:
- 11.1.
-
selectWithIndex
Returns a new MutableLongCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedLongIterable- Since:
- 11.1.
-
rejectWithIndex
Returns a new MutableLongList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceLongList- Specified by:
rejectWithIndexin interfaceMutableLongList- Specified by:
rejectWithIndexin interfaceOrderedLongIterable- Specified by:
rejectWithIndexin interfaceReversibleLongIterable- Since:
- 11.1.
-
rejectWithIndex
Returns a new MutableLongCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedLongIterable- 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 interfaceLongList- Specified by:
collectWithIndexin interfaceMutableLongList- Specified by:
collectWithIndexin interfaceOrderedLongIterable- Specified by:
collectWithIndexin interfaceReversibleLongIterable- Since:
- 9.1.
-
collectWithIndex
public <V, R extends Collection<V>> R collectWithIndex(LongIntToObjectFunction<? 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 interfaceOrderedLongIterable- Since:
- 9.1.
-
toStack
Description copied from interface:OrderedLongIterableConverts the collection to a LongStack.- Specified by:
toStackin interfaceOrderedLongIterable
-
spliterator
This function needs to be synchronized manually- Specified by:
spliteratorin interfaceLongList
-