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