Search in sources :

Example 16 with FloatArrayList

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

the class AbstractLazyIterableTestCase method collectFloatWithTarget.

@Test
public void collectFloatWithTarget() {
    MutableFloatCollection target = new FloatArrayList();
    MutableFloatCollection result = this.lazyIterable.collectFloat(PrimitiveFunctions.unboxIntegerToFloat(), target);
    Assert.assertEquals(FloatArrayList.newListWith(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f), result.toList());
    Assert.assertSame("Target list sent as parameter not returned", target, result);
}
Also used : MutableFloatCollection(org.eclipse.collections.api.collection.primitive.MutableFloatCollection) FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList) Test(org.junit.Test)

Example 17 with FloatArrayList

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

the class ArrayListIterateTest method collectFloatWithTarget.

@Test
public void collectFloatWithTarget() {
    ArrayList<Integer> list = this.createIntegerList();
    MutableFloatList target = new FloatArrayList();
    MutableFloatList actual = ArrayListIterate.collectFloat(list, PrimitiveFunctions.unboxIntegerToFloat(), target);
    Assert.assertSame("Target list sent as parameter not returned", target, actual);
    Assert.assertEquals(FloatArrayList.newListWith(-1.0f, 0.0f, 4.0f), actual);
}
Also used : FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList) MutableFloatList(org.eclipse.collections.api.list.primitive.MutableFloatList) Test(org.junit.Test)

Example 18 with FloatArrayList

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

the class RandomAccessListAdapter method collectFloat.

@Override
public MutableFloatList collectFloat(FloatFunction<? super T> 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 19 with FloatArrayList

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

the class ImmutableEmptySortedBagTest method collectFloat.

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

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