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();
}
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);
}
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;
}
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;
}
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());
}
Aggregations