use of org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet in project eclipse-collections by eclipse.
the class SetAdapter method collectFloat.
@Override
public MutableFloatSet collectFloat(FloatFunction<? super T> floatFunction) {
FloatHashSet result = new FloatHashSet(this.size());
this.forEach(new CollectFloatProcedure<>(floatFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet in project eclipse-collections by eclipse.
the class AbstractImmutableSet method collectFloat.
@Override
public ImmutableFloatSet collectFloat(FloatFunction<? super T> floatFunction) {
MutableFloatSet result = new FloatHashSet(this.size());
this.forEach(new CollectFloatProcedure<>(floatFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet in project eclipse-collections by eclipse.
the class AbstractMutableSet method collectFloat.
@Override
public MutableFloatSet collectFloat(FloatFunction<? super T> floatFunction) {
MutableFloatSet result = new FloatHashSet(this.size());
this.forEach(new CollectFloatProcedure<>(floatFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet in project eclipse-collections by eclipse.
the class StackIterableTestCase method collectFloatWithTarget.
@Override
@Test
public void collectFloatWithTarget() {
FloatHashSet target = new FloatHashSet();
StackIterable<Integer> stack = this.newStackFromTopToBottom(1, 2, 3);
FloatHashSet result = stack.collectFloat(PrimitiveFunctions.unboxIntegerToFloat(), target);
Assert.assertEquals(FloatHashSet.newSetWith(1, 2, 3), result);
Assert.assertSame("Target sent as parameter not returned", target, result);
}
Aggregations