Search in sources :

Example 16 with DoubleArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList in project eclipse-collections by eclipse.

the class ArrayListAdapter method collectDouble.

@Override
public MutableDoubleList collectDouble(DoubleFunction<? super T> doubleFunction) {
    DoubleArrayList result = new DoubleArrayList(this.size());
    this.each(each -> result.add(doubleFunction.doubleValueOf(each)));
    return result;
}
Also used : DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)

Example 17 with DoubleArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList in project eclipse-collections by eclipse.

the class AbstractImmutableList method collectDouble.

@Override
public ImmutableDoubleList collectDouble(DoubleFunction<? super T> doubleFunction) {
    DoubleArrayList result = new DoubleArrayList(this.size());
    this.forEach(new CollectDoubleProcedure<>(doubleFunction, result));
    return result.toImmutable();
}
Also used : DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)

Example 18 with DoubleArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList in project eclipse-collections by eclipse.

the class RandomAccessListAdapter method collectDouble.

@Override
public MutableDoubleList collectDouble(DoubleFunction<? super T> doubleFunction) {
    DoubleArrayList result = new DoubleArrayList(this.size());
    this.forEach(new CollectDoubleProcedure<>(doubleFunction, result));
    return result;
}
Also used : DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)

Example 19 with DoubleArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList in project eclipse-collections by eclipse.

the class ImmutableEmptySortedBagTest method collectDouble_target.

@Override
@Test
public void collectDouble_target() {
    ImmutableSortedBag<Integer> bag = this.classUnderTest();
    Assert.assertEquals(new DoubleArrayList(), bag.collectDouble(PrimitiveFunctions.unboxIntegerToDouble(), new DoubleArrayList()));
    ImmutableSortedBag<Integer> bag2 = this.classUnderTest();
    Assert.assertEquals(new DoubleHashBag(), bag2.collectDouble(PrimitiveFunctions.unboxIntegerToDouble(), new DoubleHashBag()));
}
Also used : DoubleHashBag(org.eclipse.collections.impl.bag.mutable.primitive.DoubleHashBag) DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList) Test(org.junit.Test)

Example 20 with DoubleArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList in project eclipse-collections by eclipse.

the class ImmutableEmptySortedBagTest method collectDouble.

@Override
@Test
public void collectDouble() {
    ImmutableSortedBag<Integer> bag = this.classUnderTest();
    Assert.assertEquals(new DoubleArrayList(), bag.collectDouble(PrimitiveFunctions.unboxIntegerToDouble()));
}
Also used : DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList) Test(org.junit.Test)

Aggregations

DoubleArrayList (org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)20 Test (org.junit.Test)9 ArrayList (java.util.ArrayList)3 MutableDoubleCollection (org.eclipse.collections.api.collection.primitive.MutableDoubleCollection)3 MutableDoubleList (org.eclipse.collections.api.list.primitive.MutableDoubleList)3 BooleanArrayList (org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList)2 ByteArrayList (org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)2 CharArrayList (org.eclipse.collections.impl.list.mutable.primitive.CharArrayList)2 FloatArrayList (org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)2 IntArrayList (org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)2 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)2 ShortArrayList (org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList)2 Test (org.junit.jupiter.api.Test)2 BigInteger (java.math.BigInteger)1 Distributor (jcog.math.Distributor)1 RectDouble1D (jcog.tree.rtree.rect.RectDouble1D)1 Stats (jcog.tree.rtree.util.Stats)1 DoubleIterable (org.eclipse.collections.api.DoubleIterable)1 DoubleHashBag (org.eclipse.collections.impl.bag.mutable.primitive.DoubleHashBag)1