use of org.eclipse.collections.impl.set.mutable.primitive.DoubleHashSet in project eclipse-collections by eclipse.
the class AbstractMutableSet method collectDouble.
@Override
public MutableDoubleSet collectDouble(DoubleFunction<? super T> doubleFunction) {
MutableDoubleSet result = new DoubleHashSet(this.size());
this.forEach(new CollectDoubleProcedure<>(doubleFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.DoubleHashSet in project eclipse-collections by eclipse.
the class StackIterableTestCase method collectDoubleWithTarget.
@Override
@Test
public void collectDoubleWithTarget() {
DoubleHashSet target = new DoubleHashSet();
StackIterable<Integer> stack = this.newStackFromTopToBottom(1, 2, 3);
DoubleHashSet result = stack.collectDouble(PrimitiveFunctions.unboxIntegerToDouble(), target);
Assert.assertEquals(DoubleHashSet.newSetWith(1, 2, 3), result);
Assert.assertSame("Target sent as parameter not returned", target, result);
}
use of org.eclipse.collections.impl.set.mutable.primitive.DoubleHashSet in project eclipse-collections by eclipse.
the class AbstractImmutableSet method collectDouble.
@Override
public ImmutableDoubleSet collectDouble(DoubleFunction<? super T> doubleFunction) {
MutableDoubleSet result = new DoubleHashSet(this.size());
this.forEach(new CollectDoubleProcedure<>(doubleFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.set.mutable.primitive.DoubleHashSet in project eclipse-collections by eclipse.
the class SetAdapter method collectDouble.
@Override
public MutableDoubleSet collectDouble(DoubleFunction<? super T> doubleFunction) {
DoubleHashSet result = new DoubleHashSet(this.size());
this.forEach(new CollectDoubleProcedure<>(doubleFunction, result));
return result;
}
Aggregations