Search in sources :

Example 1 with FloatHashSet

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;
}
Also used : FloatHashSet(org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet)

Example 2 with FloatHashSet

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();
}
Also used : MutableFloatSet(org.eclipse.collections.api.set.primitive.MutableFloatSet) FloatHashSet(org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet)

Example 3 with FloatHashSet

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;
}
Also used : MutableFloatSet(org.eclipse.collections.api.set.primitive.MutableFloatSet) FloatHashSet(org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet)

Example 4 with FloatHashSet

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);
}
Also used : FloatHashSet(org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Test(org.junit.Test)

Aggregations

FloatHashSet (org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet)4 MutableFloatSet (org.eclipse.collections.api.set.primitive.MutableFloatSet)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Test (org.junit.Test)1