Search in sources :

Example 11 with FloatArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.

the class AbstractImmutableList method collectFloat.

@Override
public ImmutableFloatList collectFloat(FloatFunction<? super T> floatFunction) {
    FloatArrayList result = new FloatArrayList(this.size());
    this.forEach(new CollectFloatProcedure<>(floatFunction, result));
    return result.toImmutable();
}
Also used : FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)

Example 12 with FloatArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.

the class ImmutableEmptySortedBagTest method collectFloat_target.

@Override
@Test
public void collectFloat_target() {
    ImmutableSortedBag<Integer> bag = this.classUnderTest();
    Assert.assertEquals(new FloatArrayList(), bag.collectFloat(PrimitiveFunctions.unboxIntegerToFloat(), new FloatArrayList()));
    ImmutableSortedBag<Integer> bag2 = this.classUnderTest();
    Assert.assertEquals(new FloatHashBag(), bag2.collectFloat(PrimitiveFunctions.unboxIntegerToFloat(), new FloatHashBag()));
}
Also used : FloatHashBag(org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag) FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList) Test(org.junit.Test)

Example 13 with FloatArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.

the class OrderedMapAdapter method collectFloat.

@Override
public MutableFloatList collectFloat(FloatFunction<? super V> floatFunction) {
    FloatArrayList result = new FloatArrayList(this.size());
    this.forEach(new CollectFloatProcedure<>(floatFunction, result));
    return result;
}
Also used : FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)

Example 14 with FloatArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.

the class AbstractImmutableSortedMap method collectFloat.

@Override
public ImmutableFloatList collectFloat(FloatFunction<? super V> floatFunction) {
    FloatArrayList result = new FloatArrayList(this.size());
    this.forEach(new CollectFloatProcedure<>(floatFunction, result));
    return result.toImmutable();
}
Also used : FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)

Example 15 with FloatArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.

the class AbstractImmutableSortedSet method collectFloat.

@Override
public ImmutableFloatList collectFloat(FloatFunction<? super T> floatFunction) {
    FloatArrayList result = new FloatArrayList(this.size());
    this.forEach(new CollectFloatProcedure<>(floatFunction, result));
    return result.toImmutable();
}
Also used : FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)

Aggregations

FloatArrayList (org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)19 Test (org.junit.Test)9 MutableFloatCollection (org.eclipse.collections.api.collection.primitive.MutableFloatCollection)3 MutableFloatList (org.eclipse.collections.api.list.primitive.MutableFloatList)3 ArrayList (java.util.ArrayList)2 BooleanArrayList (org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList)2 ByteArrayList (org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)2 CharArrayList (org.eclipse.collections.impl.list.mutable.primitive.CharArrayList)2 DoubleArrayList (org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)2 IntArrayList (org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)2 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)2 ShortArrayList (org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList)2 BigInteger (java.math.BigInteger)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Util (jcog.Util)1 ListTopic (jcog.event.ListTopic)1 Topic (jcog.event.Topic)1 Loop (jcog.exe.Loop)1 OneDHaar (jcog.math.OneDHaar)1 FloatIterable (org.eclipse.collections.api.FloatIterable)1