Class SynchronizedDoubleList
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedDoubleCollection
org.eclipse.collections.impl.list.mutable.primitive.SynchronizedDoubleList
- All Implemented Interfaces:
Serializable,MutableDoubleCollection,DoubleIterable,DoubleList,MutableDoubleList,OrderedDoubleIterable,ReversibleDoubleIterable,PrimitiveIterable
public class SynchronizedDoubleList
extends AbstractSynchronizedDoubleCollection
implements MutableDoubleList
A synchronized view of a
MutableDoubleList. 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAllAtIndex(int index, double... source) booleanaddAllAtIndex(int index, DoubleIterable source) voidaddAtIndex(int index, double element) asLazy()Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.intbinarySearch(double value) <V> MutableList<V>collect(DoubleToObjectFunction<? 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(DoubleIntToObjectFunction<? 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(DoubleIntToObjectFunction<? 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()doubledotProduct(DoubleList list) booleanFollows the same general contract asList.equals(Object).voidforEachWithIndex(DoubleIntProcedure procedure) doubleget(int index) doublegetFirst()doublegetLast()inthashCode()Follows the same general contract asList.hashCode().intindexOf(double value) <T> TinjectIntoWithIndex(T injectedValue, ObjectDoubleIntToObjectFunction<? super T, ? extends T> function) intlastIndexOf(double value) newEmpty()Creates a new empty mutable version of the same List type.reject(DoublePredicate predicate) Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.doubleremoveAtIndex(int index) select(DoublePredicate predicate) Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.doubleset(int index, double 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(DoubleComparator comparator) Sorts the internal data structure of this list and returns the list itself as a convenience.sortThisBy(DoubleToObjectFunction<T> function) Sorts the internal data structure of this list based on the natural order of the key returned byfunction.sortThisBy(DoubleToObjectFunction<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.with(double element) withAll(DoubleIterable elements) without(double element) withoutAll(DoubleIterable elements) <T> MutableList<DoubleObjectPair<T>>Returns aMutableListformed from thisMutableDoubleListand aListIterableby combining corresponding elements in pairs.zipDouble(DoubleIterable iterable) Returns aMutableListformed from thisMutableDoubleListand anotherDoubleListby combining corresponding elements in pairs.Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedDoubleCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, doubleIterator, each, forEach, injectInto, 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, toStringMethods inherited from interface org.eclipse.collections.api.DoubleIterable
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, 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 org.eclipse.collections.api.list.primitive.DoubleList
primitiveParallelStream, primitiveStreamMethods inherited from interface org.eclipse.collections.api.collection.primitive.MutableDoubleCollection
add, addAll, addAll, clear, doubleIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAllMethods inherited from interface org.eclipse.collections.api.list.primitive.MutableDoubleList
swap, tapMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Constructor Details
-
SynchronizedDoubleList
-
SynchronizedDoubleList
-
-
Method Details
-
get
public double get(int index) - Specified by:
getin interfaceDoubleList
-
getFirst
public double getFirst()- Specified by:
getFirstin interfaceOrderedDoubleIterable
-
getLast
public double getLast()- Specified by:
getLastin interfaceReversibleDoubleIterable
-
indexOf
public int indexOf(double value) - Specified by:
indexOfin interfaceOrderedDoubleIterable
-
lastIndexOf
public int lastIndexOf(double value) - Specified by:
lastIndexOfin interfaceDoubleList
-
addAtIndex
public void addAtIndex(int index, double element) - Specified by:
addAtIndexin interfaceMutableDoubleList
-
addAllAtIndex
public boolean addAllAtIndex(int index, double... source) - Specified by:
addAllAtIndexin interfaceMutableDoubleList
-
addAllAtIndex
- Specified by:
addAllAtIndexin interfaceMutableDoubleList
-
removeAtIndex
public double removeAtIndex(int index) - Specified by:
removeAtIndexin interfaceMutableDoubleList
-
set
public double set(int index, double element) - Specified by:
setin interfaceMutableDoubleList
-
with
- Specified by:
within interfaceMutableDoubleCollection- Specified by:
within interfaceMutableDoubleList- Overrides:
within classAbstractSynchronizedDoubleCollection
-
without
- Specified by:
withoutin interfaceMutableDoubleCollection- Specified by:
withoutin interfaceMutableDoubleList- Overrides:
withoutin classAbstractSynchronizedDoubleCollection
-
withAll
- Specified by:
withAllin interfaceMutableDoubleCollection- Specified by:
withAllin interfaceMutableDoubleList- Overrides:
withAllin classAbstractSynchronizedDoubleCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableDoubleCollection- Specified by:
withoutAllin interfaceMutableDoubleList- Overrides:
withoutAllin classAbstractSynchronizedDoubleCollection
-
select
Description copied from interface:DoubleIterableReturns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.- Specified by:
selectin interfaceDoubleIterable- Specified by:
selectin interfaceDoubleList- Specified by:
selectin interfaceMutableDoubleCollection- Specified by:
selectin interfaceMutableDoubleList- Specified by:
selectin interfaceOrderedDoubleIterable- Specified by:
selectin interfaceReversibleDoubleIterable- Overrides:
selectin classAbstractSynchronizedDoubleCollection
-
reject
Description copied from interface:DoubleIterableReturns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.- Specified by:
rejectin interfaceDoubleIterable- Specified by:
rejectin interfaceDoubleList- Specified by:
rejectin interfaceMutableDoubleCollection- Specified by:
rejectin interfaceMutableDoubleList- Specified by:
rejectin interfaceOrderedDoubleIterable- Specified by:
rejectin interfaceReversibleDoubleIterable- Overrides:
rejectin classAbstractSynchronizedDoubleCollection
-
collect
Description copied from interface:DoubleIterableReturns 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 interfaceDoubleIterable- Specified by:
collectin interfaceDoubleList- Specified by:
collectin interfaceMutableDoubleCollection- Specified by:
collectin interfaceMutableDoubleList- Specified by:
collectin interfaceOrderedDoubleIterable- Specified by:
collectin interfaceReversibleDoubleIterable- Overrides:
collectin classAbstractSynchronizedDoubleCollection
-
sortThis
Description copied from interface:MutableDoubleListSorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThisin interfaceMutableDoubleList
-
sortThis
Description copied from interface:MutableDoubleListSorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThisin interfaceMutableDoubleList
-
sortThisBy
Description copied from interface:MutableDoubleListSorts the internal data structure of this list based on the natural order of the key returned byfunction.- Specified by:
sortThisByin interfaceMutableDoubleList
-
sortThisBy
public <T> MutableDoubleList sortThisBy(DoubleToObjectFunction<T> function, Comparator<? super T> comparator) Description copied from interface:MutableDoubleListSorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.- Specified by:
sortThisByin interfaceMutableDoubleList
-
shuffleThis
Description copied from interface:MutableDoubleListRandomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Randomas the source of randomness.- Specified by:
shuffleThisin interfaceMutableDoubleList
-
shuffleThis
Description copied from interface:MutableDoubleListRandomly 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 interfaceMutableDoubleList
-
binarySearch
public int binarySearch(double value) - Specified by:
binarySearchin interfaceDoubleList
-
dotProduct
- Specified by:
dotProductin interfaceDoubleList
-
equals
Description copied from interface:DoubleListFollows the same general contract asList.equals(Object).- Specified by:
equalsin interfaceDoubleList- Overrides:
equalsin classObject
-
hashCode
public int hashCode()Description copied from interface:DoubleListFollows the same general contract asList.hashCode().- Specified by:
hashCodein interfaceDoubleList- Overrides:
hashCodein classObject
-
asLazy
Description copied from interface:DoubleIterableReturns a LazyDoubleIterable adapter wrapping the source DoubleIterable.- Specified by:
asLazyin interfaceDoubleIterable- Overrides:
asLazyin classAbstractSynchronizedDoubleCollection
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableDoubleCollection- Specified by:
asUnmodifiablein interfaceMutableDoubleList- Overrides:
asUnmodifiablein classAbstractSynchronizedDoubleCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableDoubleCollection- Specified by:
asSynchronizedin interfaceMutableDoubleList- Overrides:
asSynchronizedin classAbstractSynchronizedDoubleCollection
-
toImmutable
Description copied from interface:MutableDoubleListReturns an immutable copy of this list.- Specified by:
toImmutablein interfaceDoubleList- Specified by:
toImmutablein interfaceMutableDoubleCollection- Specified by:
toImmutablein interfaceMutableDoubleList- Overrides:
toImmutablein classAbstractSynchronizedDoubleCollection
-
newEmpty
Description copied from interface:MutableDoubleListCreates a new empty mutable version of the same List type.- Specified by:
newEmptyin interfaceMutableDoubleCollection- Specified by:
newEmptyin interfaceMutableDoubleList- Since:
- 9.2.
-
reverseThis
- Specified by:
reverseThisin interfaceMutableDoubleList
-
toReversed
- Specified by:
toReversedin interfaceDoubleList- Specified by:
toReversedin interfaceMutableDoubleList- Specified by:
toReversedin interfaceReversibleDoubleIterable
-
asReversed
- Specified by:
asReversedin interfaceReversibleDoubleIterable
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedDoubleIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectDoubleIntToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoWithIndexin interfaceOrderedDoubleIterable- Specified by:
injectIntoWithIndexin interfaceReversibleDoubleIterable
-
distinct
- Specified by:
distinctin interfaceDoubleList- Specified by:
distinctin interfaceMutableDoubleList- Specified by:
distinctin interfaceReversibleDoubleIterable- Since:
- 6.0.
-
subList
- Specified by:
subListin interfaceDoubleList- Specified by:
subListin interfaceMutableDoubleList- See Also:
-
zipDouble
Description copied from interface:MutableDoubleListReturns aMutableListformed from thisMutableDoubleListand anotherDoubleListby combining corresponding elements in pairs. If one of the twoDoubleLists is longer than the other, its remaining elements are ignored.- Specified by:
zipDoublein interfaceDoubleList- Specified by:
zipDoublein interfaceMutableDoubleList- Since:
- 9.1.
-
zip
Description copied from interface:MutableDoubleListReturns aMutableListformed from thisMutableDoubleListand 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 interfaceDoubleList- Specified by:
zipin interfaceMutableDoubleList- Since:
- 9.1.
-
collectWithIndex
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceDoubleList- Specified by:
collectWithIndexin interfaceMutableDoubleList- Specified by:
collectWithIndexin interfaceOrderedDoubleIterable- Specified by:
collectWithIndexin interfaceReversibleDoubleIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(DoubleIntToObjectFunction<? 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 interfaceOrderedDoubleIterable- Since:
- 9.1.
-
spliterator
This function needs to be synchronized manually- Specified by:
spliteratorin interfaceDoubleList
-