Search in sources :

Example 1 with DoubleArrayList

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

the class AbstractImmutableSortedSet 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 2 with DoubleArrayList

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

the class AbstractLazyIterableTestCase method collectDoubleWithTarget.

@Test
public void collectDoubleWithTarget() {
    MutableDoubleCollection target = new DoubleArrayList();
    MutableDoubleCollection result = this.lazyIterable.collectDouble(PrimitiveFunctions.unboxIntegerToDouble(), target);
    Assert.assertEquals(DoubleArrayList.newListWith(1.0d, 2.0d, 3.0d, 4.0d, 5.0d, 6.0d, 7.0d), result.toList());
    Assert.assertSame("Target list sent as parameter not returned", target, result);
}
Also used : MutableDoubleCollection(org.eclipse.collections.api.collection.primitive.MutableDoubleCollection) DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList) Test(org.junit.Test)

Example 3 with DoubleArrayList

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

the class OrderedMapAdapter method collectDouble.

@Override
public MutableDoubleList collectDouble(DoubleFunction<? super V> 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 4 with DoubleArrayList

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

the class AbstractMutableSortedMap method collectDouble.

@Override
public MutableDoubleList collectDouble(DoubleFunction<? super V> 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 5 with DoubleArrayList

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

the class AbstractRichIterableTestCase method collectDoubleWithTarget.

@Test
public void collectDoubleWithTarget() {
    MutableDoubleCollection target = new DoubleArrayList();
    DoubleIterable result = this.newWith(1, 2, 3, 4).collectDouble(PrimitiveFunctions.unboxIntegerToDouble(), target);
    Assert.assertSame("Target list sent as parameter not returned", target, result);
    Assert.assertEquals(DoubleHashBag.newBagWith(1.0d, 2.0d, 3.0d, 4.0d), result.toBag());
}
Also used : MutableDoubleCollection(org.eclipse.collections.api.collection.primitive.MutableDoubleCollection) DoubleIterable(org.eclipse.collections.api.DoubleIterable) 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