use of org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag in project eclipse-collections by eclipse.
the class AbstractImmutableMap method collectFloat.
@Override
public ImmutableFloatBag collectFloat(FloatFunction<? super V> floatFunction) {
MutableFloatBag result = new FloatHashBag();
this.forEach(new CollectFloatProcedure<>(floatFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag in project eclipse-collections by eclipse.
the class AbstractMutableMap method collectFloat.
@Override
public MutableFloatBag collectFloat(FloatFunction<? super V> floatFunction) {
MutableFloatBag result = new FloatHashBag();
this.forEach(new CollectFloatProcedure<>(floatFunction, result));
return result;
}
use of org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag in project eclipse-collections by eclipse.
the class AbstractRichIterableTestCase method collectFloatWithBagTarget.
@Test
public void collectFloatWithBagTarget() {
FloatHashBag target = new FloatHashBag();
FloatHashBag result = this.newWith(1, 2, 3, 4).collectFloat(PrimitiveFunctions.unboxIntegerToFloat(), target);
Assert.assertSame("Target list sent as parameter not returned", target, result);
Assert.assertEquals(FloatHashBag.newBagWith(1.0f, 2.0f, 3.0f, 4.0f), result);
}
Aggregations