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 aMutableLongList. 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:
MutableLongList.asSynchronized(),MutableList.asSynchronized(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedLongList(MutableLongList list)SynchronizedLongList(MutableLongList list, Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAllAtIndex(int index, long... source)booleanaddAllAtIndex(int index, LongIterable source)voidaddAtIndex(int index, long element)LazyLongIterableasLazy()LazyLongIterableasReversed()MutableLongListasSynchronized()MutableLongListasUnmodifiable()intbinarySearch(long value)MutableList<Long>boxed()<V> MutableList<V>collect(LongToObjectFunction<? extends V> function)<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.MutableLongListdistinct()longdotProduct(LongList list)booleanequals(Object otherList)voidforEachInBoth(LongList other, LongLongProcedure procedure)voidforEachWithIndex(LongIntProcedure procedure)longget(int index)longgetFirst()longgetLast()inthashCode()intindexOf(long value)<T> TinjectIntoWithIndex(T injectedValue, ObjectLongIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(long value)MutableLongListnewEmpty()MutableLongListreject(LongPredicate predicate)MutableLongListrejectWithIndex(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)MutableLongListreverseThis()MutableLongListselect(LongPredicate predicate)MutableLongListselectWithIndex(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)MutableLongListshuffleThis()MutableLongListshuffleThis(Random rnd)MutableLongListsortThis()MutableLongListsortThis(LongComparator comparator)<T> MutableLongListsortThisBy(LongToObjectFunction<T> function)<T> MutableLongListsortThisBy(LongToObjectFunction<T> function, Comparator<? super T> comparator)Spliterator.OfLongspliterator()This function needs to be synchronized manuallyMutableLongListsubList(int fromIndex, int toIndex)ImmutableLongListtoImmutable()MutableLongListtoReversed()SynchronizedLongListwith(long element)SynchronizedLongListwithAll(LongIterable elements)SynchronizedLongListwithout(long element)SynchronizedLongListwithoutAll(LongIterable elements)<T> MutableList<LongObjectPair<T>>zip(Iterable<T> iterable)MutableList<LongLongPair>zipLong(LongIterable iterable)-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, 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, toString
-
Methods inherited from interface org.eclipse.collections.api.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, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.LongList
primitiveParallelStream, primitiveStream
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableLongCollection
add, addAll, addAll, clear, longIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableLongList
swap, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Constructor Detail
-
SynchronizedLongList
public SynchronizedLongList(MutableLongList list)
-
SynchronizedLongList
public SynchronizedLongList(MutableLongList list, Object newLock)
-
-
Method Detail
-
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
public boolean addAllAtIndex(int index, LongIterable source)- 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
public SynchronizedLongList with(long element)
- Specified by:
within interfaceMutableLongCollection- Specified by:
within interfaceMutableLongList- Overrides:
within classAbstractSynchronizedLongCollection
-
without
public SynchronizedLongList without(long element)
- Specified by:
withoutin interfaceMutableLongCollection- Specified by:
withoutin interfaceMutableLongList- Overrides:
withoutin classAbstractSynchronizedLongCollection
-
withAll
public SynchronizedLongList withAll(LongIterable elements)
- Specified by:
withAllin interfaceMutableLongCollection- Specified by:
withAllin interfaceMutableLongList- Overrides:
withAllin classAbstractSynchronizedLongCollection
-
withoutAll
public SynchronizedLongList withoutAll(LongIterable elements)
- Specified by:
withoutAllin interfaceMutableLongCollection- Specified by:
withoutAllin interfaceMutableLongList- Overrides:
withoutAllin classAbstractSynchronizedLongCollection
-
select
public MutableLongList select(LongPredicate 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
public MutableList<Long> boxed()
- Specified by:
boxedin interfaceMutableLongList
-
reject
public MutableLongList reject(LongPredicate 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
public <V> MutableList<V> collect(LongToObjectFunction<? extends V> function)
- 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
public MutableLongList sortThis()
- Specified by:
sortThisin interfaceMutableLongList
-
sortThis
public MutableLongList sortThis(LongComparator comparator)
- Specified by:
sortThisin interfaceMutableLongList
-
sortThisBy
public <T> MutableLongList sortThisBy(LongToObjectFunction<T> function)
- Specified by:
sortThisByin interfaceMutableLongList
-
sortThisBy
public <T> MutableLongList sortThisBy(LongToObjectFunction<T> function, Comparator<? super T> comparator)
- Specified by:
sortThisByin interfaceMutableLongList
-
shuffleThis
public MutableLongList shuffleThis()
- Specified by:
shuffleThisin interfaceMutableLongList
-
shuffleThis
public MutableLongList shuffleThis(Random rnd)
- Specified by:
shuffleThisin interfaceMutableLongList
-
binarySearch
public int binarySearch(long value)
- Specified by:
binarySearchin interfaceLongList
-
dotProduct
public long dotProduct(LongList list)
- Specified by:
dotProductin interfaceLongList
-
equals
public boolean equals(Object otherList)
-
hashCode
public int hashCode()
-
asLazy
public LazyLongIterable asLazy()
- Specified by:
asLazyin interfaceLongIterable- Overrides:
asLazyin classAbstractSynchronizedLongCollection
-
asUnmodifiable
public MutableLongList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableLongCollection- Specified by:
asUnmodifiablein interfaceMutableLongList- Overrides:
asUnmodifiablein classAbstractSynchronizedLongCollection
-
asSynchronized
public MutableLongList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableLongCollection- Specified by:
asSynchronizedin interfaceMutableLongList- Overrides:
asSynchronizedin classAbstractSynchronizedLongCollection
-
toImmutable
public ImmutableLongList toImmutable()
- Specified by:
toImmutablein interfaceLongList- Specified by:
toImmutablein interfaceMutableLongCollection- Specified by:
toImmutablein interfaceMutableLongList- Overrides:
toImmutablein classAbstractSynchronizedLongCollection
-
newEmpty
public MutableLongList newEmpty()
- Specified by:
newEmptyin interfaceMutableLongCollection- Specified by:
newEmptyin interfaceMutableLongList- Since:
- 9.2.
-
reverseThis
public MutableLongList reverseThis()
- Specified by:
reverseThisin interfaceMutableLongList
-
toReversed
public MutableLongList toReversed()
- Specified by:
toReversedin interfaceLongList- Specified by:
toReversedin interfaceMutableLongList- Specified by:
toReversedin interfaceReversibleLongIterable
-
asReversed
public LazyLongIterable asReversed()
- Specified by:
asReversedin interfaceReversibleLongIterable
-
forEachInBoth
public void forEachInBoth(LongList other, LongLongProcedure procedure)
- Specified by:
forEachInBothin interfaceLongList
-
forEachWithIndex
public void forEachWithIndex(LongIntProcedure procedure)
- 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
public MutableLongList distinct()
- Specified by:
distinctin interfaceLongList- Specified by:
distinctin interfaceMutableLongList- Specified by:
distinctin interfaceReversibleLongIterable- Since:
- 6.0.
-
subList
public MutableLongList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceLongList- Specified by:
subListin interfaceMutableLongList
-
zipLong
public MutableList<LongLongPair> zipLong(LongIterable iterable)
- Specified by:
zipLongin interfaceLongList- Specified by:
zipLongin interfaceMutableLongList- Since:
- 9.1.
-
zip
public <T> MutableList<LongObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zipin interfaceLongList- Specified by:
zipin interfaceMutableLongList- Since:
- 9.1.
-
selectWithIndex
public MutableLongList selectWithIndex(LongIntPredicate predicate)
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
public <R extends MutableLongCollection> R selectWithIndex(LongIntPredicate predicate, R target)
Returns a new MutableLongCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedLongIterable- Since:
- 11.1.
-
rejectWithIndex
public MutableLongList rejectWithIndex(LongIntPredicate predicate)
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
public <R extends MutableLongCollection> R rejectWithIndex(LongIntPredicate predicate, R target)
Returns a new MutableLongCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedLongIterable- Since:
- 11.1.
-
collectWithIndex
public <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.- 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.
-
spliterator
public Spliterator.OfLong spliterator()
This function needs to be synchronized manually- Specified by:
spliteratorin interfaceLongList
-
-