Class DoubleArrayList
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractDoubleIterable
-
- org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList
-
- All Implemented Interfaces:
Externalizable,Serializable,MutableDoubleCollection,DoubleIterable,DoubleList,MutableDoubleList,OrderedDoubleIterable,ReversibleDoubleIterable,PrimitiveIterable
public class DoubleArrayList extends AbstractDoubleIterable implements MutableDoubleList, Externalizable
DoubleArrayList is similar to FastList, and is memory-optimized for double primitives. This file was automatically generated from template file primitiveArrayList.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DoubleArrayList()DoubleArrayList(double... array)DoubleArrayList(int initialCapacity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(double newItem)booleanaddAll(double... source)booleanaddAll(DoubleIterable source)booleanaddAllAtIndex(int index, double... source)booleanaddAllAtIndex(int index, DoubleIterable source)voidaddAtIndex(int index, double element)booleanallSatisfy(DoublePredicate predicate)booleananySatisfy(DoublePredicate predicate)voidappendString(Appendable appendable, String start, String separator, String end)LazyDoubleIterableasReversed()MutableDoubleListasSynchronized()MutableDoubleListasUnmodifiable()intbinarySearch(double value)MutableList<Double>boxed()RichIterable<DoubleIterable>chunk(int size)voidclear()<V> MutableList<V>collect(DoubleToObjectFunction<? extends V> function)<V,R extends Collection<V>>
Rcollect(DoubleToObjectFunction<? extends V> function, R target)booleancontains(double value)intcount(DoublePredicate predicate)doubledetectIfNone(DoublePredicate predicate, double ifNone)MutableDoubleListdistinct()doubledotProduct(DoubleList list)MutableDoubleIteratordoubleIterator()voideach(DoubleProcedure procedure)voidensureCapacity(int minCapacity)booleanequals(Object otherList)voidforEachWithIndex(DoubleIntProcedure procedure)doubleget(int index)doublegetFirst()doublegetLast()inthashCode()intindexOf(double value)<T> TinjectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectDoubleIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(double value)doublemax()doublemin()DoubleArrayListnewEmpty()Creates a new empty DoubleArrayList.static DoubleArrayListnewList(DoubleIterable source)static DoubleArrayListnewListWith(double... elements)Creates a new list using the passedelementsargument as the backing store.static DoubleArrayListnewWithNValues(int size, double value)voidreadExternal(ObjectInput in)DoubleArrayListreject(DoublePredicate predicate)<R extends MutableDoubleCollection>
Rreject(DoublePredicate predicate, R target)booleanremove(double value)booleanremoveAll(double... source)booleanremoveAll(DoubleIterable source)doubleremoveAtIndex(int index)booleanremoveIf(DoublePredicate predicate)booleanretainAll(double... source)booleanretainAll(DoubleIterable source)DoubleArrayListreverseThis()DoubleArrayListselect(DoublePredicate predicate)<R extends MutableDoubleCollection>
Rselect(DoublePredicate predicate, R target)doubleset(int index, double element)intsize()DoubleArrayListsortThis()DoubleArrayListsortThis(DoubleComparator comparator)Spliterator.OfDoublespliterator()MutableDoubleListsubList(int fromIndex, int toIndex)doublesum()voidswap(int index1, int index2)double[]toArray()double[]toArray(double[] target)ImmutableDoubleListtoImmutable()DoubleArrayListtoReversed()voidtrimToSize()DoubleArrayListwith(double element)DoubleArrayListwith(double element1, double element2)DoubleArrayListwith(double element1, double element2, double element3)DoubleArrayListwith(double element1, double element2, double element3, double... elements)DoubleArrayListwithAll(DoubleIterable elements)DoubleArrayListwithout(double element)DoubleArrayListwithoutAll(DoubleIterable elements)static DoubleArrayListwrapCopy(double... array)Creates a new list by first copying the array passed in.voidwriteExternal(ObjectOutput out)<T> MutableList<DoubleObjectPair<T>>zip(Iterable<T> iterable)MutableList<DoubleDoublePair>zipDouble(DoubleIterable iterable)-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractDoubleIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.DoubleIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.DoubleList
forEachInBoth, primitiveParallelStream, primitiveStream
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableDoubleList
collectWithIndex, rejectWithIndex, selectWithIndex, shuffleThis, shuffleThis, sortThisBy, sortThisBy, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedDoubleIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
-
-
-
Method Detail
-
newListWith
public static DoubleArrayList newListWith(double... elements)
Creates a new list using the passedelementsargument as the backing store.!!! WARNING: This method uses the passed in array, so can be very unsafe if the original array is held onto anywhere else. !!!
-
newList
public static DoubleArrayList newList(DoubleIterable source)
-
newWithNValues
public static DoubleArrayList newWithNValues(int size, double value)
-
wrapCopy
public static DoubleArrayList wrapCopy(double... array)
Creates a new list by first copying the array passed in.
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clearin interfaceMutableDoubleCollection
-
contains
public boolean contains(double value)
- Specified by:
containsin interfaceDoubleIterable
-
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
-
trimToSize
public void trimToSize()
-
ensureCapacity
public void ensureCapacity(int minCapacity)
-
add
public boolean add(double newItem)
- Specified by:
addin interfaceMutableDoubleCollection
-
addAll
public boolean addAll(double... source)
- Specified by:
addAllin interfaceMutableDoubleCollection
-
addAll
public boolean addAll(DoubleIterable source)
- Specified by:
addAllin interfaceMutableDoubleCollection
-
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
public boolean addAllAtIndex(int index, DoubleIterable source)- Specified by:
addAllAtIndexin interfaceMutableDoubleList
-
remove
public boolean remove(double value)
- Specified by:
removein interfaceMutableDoubleCollection
-
removeIf
public boolean removeIf(DoublePredicate predicate)
- Specified by:
removeIfin interfaceMutableDoubleCollection
-
removeAll
public boolean removeAll(DoubleIterable source)
- Specified by:
removeAllin interfaceMutableDoubleCollection
-
removeAll
public boolean removeAll(double... source)
- Specified by:
removeAllin interfaceMutableDoubleCollection
-
retainAll
public boolean retainAll(DoubleIterable source)
- Specified by:
retainAllin interfaceMutableDoubleCollection
-
retainAll
public boolean retainAll(double... source)
- Specified by:
retainAllin interfaceMutableDoubleCollection
-
removeAtIndex
public double removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableDoubleList
-
set
public double set(int index, double element)- Specified by:
setin interfaceMutableDoubleList
-
swap
public void swap(int index1, int index2)- Specified by:
swapin interfaceMutableDoubleList
-
with
public DoubleArrayList with(double element)
- Specified by:
within interfaceMutableDoubleCollection- Specified by:
within interfaceMutableDoubleList
-
without
public DoubleArrayList without(double element)
- Specified by:
withoutin interfaceMutableDoubleCollection- Specified by:
withoutin interfaceMutableDoubleList
-
withAll
public DoubleArrayList withAll(DoubleIterable elements)
- Specified by:
withAllin interfaceMutableDoubleCollection- Specified by:
withAllin interfaceMutableDoubleList
-
withoutAll
public DoubleArrayList withoutAll(DoubleIterable elements)
- Specified by:
withoutAllin interfaceMutableDoubleCollection- Specified by:
withoutAllin interfaceMutableDoubleList
-
with
public DoubleArrayList with(double element1, double element2)
-
with
public DoubleArrayList with(double element1, double element2, double element3)
-
with
public DoubleArrayList with(double element1, double element2, double element3, double... elements)
-
doubleIterator
public MutableDoubleIterator doubleIterator()
- Specified by:
doubleIteratorin interfaceDoubleIterable- Specified by:
doubleIteratorin interfaceMutableDoubleCollection
-
each
public void each(DoubleProcedure procedure)
- Specified by:
eachin interfaceDoubleIterable- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(DoubleIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedDoubleIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceDoubleIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectDoubleIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedDoubleIterable- Specified by:
injectIntoWithIndexin interfaceReversibleDoubleIterable
-
chunk
public RichIterable<DoubleIterable> chunk(int size)
- Specified by:
chunkin interfaceDoubleIterable
-
count
public int count(DoublePredicate predicate)
- Specified by:
countin interfaceDoubleIterable
-
anySatisfy
public boolean anySatisfy(DoublePredicate predicate)
- Specified by:
anySatisfyin interfaceDoubleIterable
-
allSatisfy
public boolean allSatisfy(DoublePredicate predicate)
- Specified by:
allSatisfyin interfaceDoubleIterable
-
select
public DoubleArrayList select(DoublePredicate 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
-
select
public <R extends MutableDoubleCollection> R select(DoublePredicate predicate, R target)
- Specified by:
selectin interfaceDoubleIterable- Since:
- 8.1.
-
reject
public DoubleArrayList reject(DoublePredicate 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
-
reject
public <R extends MutableDoubleCollection> R reject(DoublePredicate predicate, R target)
- Specified by:
rejectin interfaceDoubleIterable- Since:
- 8.1.
-
detectIfNone
public double detectIfNone(DoublePredicate predicate, double ifNone)
- Specified by:
detectIfNonein interfaceDoubleIterable
-
collect
public <V> MutableList<V> collect(DoubleToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceDoubleIterable- Specified by:
collectin interfaceDoubleList- Specified by:
collectin interfaceMutableDoubleCollection- Specified by:
collectin interfaceMutableDoubleList- Specified by:
collectin interfaceOrderedDoubleIterable- Specified by:
collectin interfaceReversibleDoubleIterable
-
collect
public <V,R extends Collection<V>> R collect(DoubleToObjectFunction<? extends V> function, R target)
- Specified by:
collectin interfaceDoubleIterable- Since:
- 8.1.
-
max
public double max()
- Specified by:
maxin interfaceDoubleIterable
-
min
public double min()
- Specified by:
minin interfaceDoubleIterable
-
sum
public double sum()
- Specified by:
sumin interfaceDoubleIterable
-
dotProduct
public double dotProduct(DoubleList list)
- Specified by:
dotProductin interfaceDoubleList
-
toArray
public double[] toArray()
- Specified by:
toArrayin interfaceDoubleIterable
-
toArray
public double[] toArray(double[] target)
- Specified by:
toArrayin interfaceDoubleIterable
-
equals
public boolean equals(Object otherList)
- Specified by:
equalsin interfaceDoubleList- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceDoubleList- Overrides:
hashCodein classObject
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
asUnmodifiable
public MutableDoubleList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableDoubleCollection- Specified by:
asUnmodifiablein interfaceMutableDoubleList
-
asSynchronized
public MutableDoubleList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableDoubleCollection- Specified by:
asSynchronizedin interfaceMutableDoubleList
-
toImmutable
public ImmutableDoubleList toImmutable()
- Specified by:
toImmutablein interfaceDoubleList- Specified by:
toImmutablein interfaceMutableDoubleCollection- Specified by:
toImmutablein interfaceMutableDoubleList
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
asReversed
public LazyDoubleIterable asReversed()
- Specified by:
asReversedin interfaceReversibleDoubleIterable
-
reverseThis
public DoubleArrayList reverseThis()
- Specified by:
reverseThisin interfaceMutableDoubleList
-
sortThis
public DoubleArrayList sortThis()
- Specified by:
sortThisin interfaceMutableDoubleList
-
sortThis
public DoubleArrayList sortThis(DoubleComparator comparator)
- Specified by:
sortThisin interfaceMutableDoubleList
-
toReversed
public DoubleArrayList toReversed()
- Specified by:
toReversedin interfaceDoubleList- Specified by:
toReversedin interfaceMutableDoubleList- Specified by:
toReversedin interfaceReversibleDoubleIterable
-
binarySearch
public int binarySearch(double value)
- Specified by:
binarySearchin interfaceDoubleList
-
distinct
public MutableDoubleList distinct()
- Specified by:
distinctin interfaceDoubleList- Specified by:
distinctin interfaceMutableDoubleList- Specified by:
distinctin interfaceReversibleDoubleIterable
-
subList
public MutableDoubleList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceDoubleList- Specified by:
subListin interfaceMutableDoubleList
-
zipDouble
public MutableList<DoubleDoublePair> zipDouble(DoubleIterable iterable)
- Specified by:
zipDoublein interfaceDoubleList- Specified by:
zipDoublein interfaceMutableDoubleList- Since:
- 9.1.
-
newEmpty
public DoubleArrayList newEmpty()
Creates a new empty DoubleArrayList.- Specified by:
newEmptyin interfaceMutableDoubleCollection- Specified by:
newEmptyin interfaceMutableDoubleList- Since:
- 9.2.
-
zip
public <T> MutableList<DoubleObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zipin interfaceDoubleList- Specified by:
zipin interfaceMutableDoubleList- Since:
- 9.1.
-
boxed
public MutableList<Double> boxed()
- Specified by:
boxedin interfaceMutableDoubleList
-
spliterator
public Spliterator.OfDouble spliterator()
- Specified by:
spliteratorin interfaceDoubleList
-
-