Search in sources :

Example 6 with IntList

use of org.eclipse.collections.api.list.primitive.IntList in project eclipse-collections by eclipse.

the class Collectors2AdditionalTest method collectIntParallel.

@Test
public void collectIntParallel() {
    IntList expected = LARGE_INTERVAL.collectInt(Integer::intValue, IntLists.mutable.empty());
    IntList actual = this.bigData.parallelStream().collect(Collectors2.collectInt(each -> each, IntLists.mutable::empty));
    Assert.assertEquals(expected, actual);
}
Also used : BigInteger(java.math.BigInteger) LongLists(org.eclipse.collections.impl.factory.primitive.LongLists) CompositeFastList(org.eclipse.collections.impl.list.mutable.CompositeFastList) LongList(org.eclipse.collections.api.list.primitive.LongList) PartitionMutableBag(org.eclipse.collections.api.partition.bag.PartitionMutableBag) DoubleLists(org.eclipse.collections.impl.factory.primitive.DoubleLists) Verify(org.eclipse.collections.impl.test.Verify) MutableList(org.eclipse.collections.api.list.MutableList) ShortList(org.eclipse.collections.api.list.primitive.ShortList) PartitionMutableSet(org.eclipse.collections.api.partition.set.PartitionMutableSet) ArrayList(java.util.ArrayList) PartitionFastList(org.eclipse.collections.impl.partition.list.PartitionFastList) BigDecimal(java.math.BigDecimal) Functions(org.eclipse.collections.impl.block.factory.Functions) ByteLists(org.eclipse.collections.impl.factory.primitive.ByteLists) Map(java.util.Map) Interval(org.eclipse.collections.impl.list.Interval) PartitionHashBag(org.eclipse.collections.impl.partition.bag.PartitionHashBag) PrimitiveTuples(org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples) BigInteger(java.math.BigInteger) DoubleList(org.eclipse.collections.api.list.primitive.DoubleList) PartitionMutableList(org.eclipse.collections.api.partition.list.PartitionMutableList) Predicates2(org.eclipse.collections.impl.block.factory.Predicates2) CharLists(org.eclipse.collections.impl.factory.primitive.CharLists) CharList(org.eclipse.collections.api.list.primitive.CharList) IntList(org.eclipse.collections.api.list.primitive.IntList) IntegerPredicates(org.eclipse.collections.impl.block.factory.IntegerPredicates) Bags(org.eclipse.collections.impl.factory.Bags) BooleanLists(org.eclipse.collections.impl.factory.primitive.BooleanLists) PartitionUnifiedSet(org.eclipse.collections.impl.partition.set.PartitionUnifiedSet) Test(org.junit.Test) Iterate(org.eclipse.collections.impl.utility.Iterate) Collectors(java.util.stream.Collectors) BooleanList(org.eclipse.collections.api.list.primitive.BooleanList) FloatLists(org.eclipse.collections.impl.factory.primitive.FloatLists) List(java.util.List) ShortLists(org.eclipse.collections.impl.factory.primitive.ShortLists) ByteList(org.eclipse.collections.api.list.primitive.ByteList) IntLists(org.eclipse.collections.impl.factory.primitive.IntLists) FloatList(org.eclipse.collections.api.list.primitive.FloatList) Lists(org.eclipse.collections.impl.factory.Lists) Sets(org.eclipse.collections.impl.factory.Sets) Assert(org.junit.Assert) IntLists(org.eclipse.collections.impl.factory.primitive.IntLists) IntList(org.eclipse.collections.api.list.primitive.IntList) Test(org.junit.Test)

Example 7 with IntList

use of org.eclipse.collections.api.list.primitive.IntList in project eclipse-collections by eclipse.

the class Collectors2AdditionalTest method collectInt.

@Test
public void collectInt() {
    IntList expected = SMALL_INTERVAL.collectInt(Integer::intValue, IntLists.mutable.empty());
    IntList actual = this.smallData.stream().collect(Collectors2.collectInt(each -> each, IntLists.mutable::empty));
    Assert.assertEquals(expected, actual);
}
Also used : BigInteger(java.math.BigInteger) LongLists(org.eclipse.collections.impl.factory.primitive.LongLists) CompositeFastList(org.eclipse.collections.impl.list.mutable.CompositeFastList) LongList(org.eclipse.collections.api.list.primitive.LongList) PartitionMutableBag(org.eclipse.collections.api.partition.bag.PartitionMutableBag) DoubleLists(org.eclipse.collections.impl.factory.primitive.DoubleLists) Verify(org.eclipse.collections.impl.test.Verify) MutableList(org.eclipse.collections.api.list.MutableList) ShortList(org.eclipse.collections.api.list.primitive.ShortList) PartitionMutableSet(org.eclipse.collections.api.partition.set.PartitionMutableSet) ArrayList(java.util.ArrayList) PartitionFastList(org.eclipse.collections.impl.partition.list.PartitionFastList) BigDecimal(java.math.BigDecimal) Functions(org.eclipse.collections.impl.block.factory.Functions) ByteLists(org.eclipse.collections.impl.factory.primitive.ByteLists) Map(java.util.Map) Interval(org.eclipse.collections.impl.list.Interval) PartitionHashBag(org.eclipse.collections.impl.partition.bag.PartitionHashBag) PrimitiveTuples(org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples) BigInteger(java.math.BigInteger) DoubleList(org.eclipse.collections.api.list.primitive.DoubleList) PartitionMutableList(org.eclipse.collections.api.partition.list.PartitionMutableList) Predicates2(org.eclipse.collections.impl.block.factory.Predicates2) CharLists(org.eclipse.collections.impl.factory.primitive.CharLists) CharList(org.eclipse.collections.api.list.primitive.CharList) IntList(org.eclipse.collections.api.list.primitive.IntList) IntegerPredicates(org.eclipse.collections.impl.block.factory.IntegerPredicates) Bags(org.eclipse.collections.impl.factory.Bags) BooleanLists(org.eclipse.collections.impl.factory.primitive.BooleanLists) PartitionUnifiedSet(org.eclipse.collections.impl.partition.set.PartitionUnifiedSet) Test(org.junit.Test) Iterate(org.eclipse.collections.impl.utility.Iterate) Collectors(java.util.stream.Collectors) BooleanList(org.eclipse.collections.api.list.primitive.BooleanList) FloatLists(org.eclipse.collections.impl.factory.primitive.FloatLists) List(java.util.List) ShortLists(org.eclipse.collections.impl.factory.primitive.ShortLists) ByteList(org.eclipse.collections.api.list.primitive.ByteList) IntLists(org.eclipse.collections.impl.factory.primitive.IntLists) FloatList(org.eclipse.collections.api.list.primitive.FloatList) Lists(org.eclipse.collections.impl.factory.Lists) Sets(org.eclipse.collections.impl.factory.Sets) Assert(org.junit.Assert) IntLists(org.eclipse.collections.impl.factory.primitive.IntLists) IntList(org.eclipse.collections.api.list.primitive.IntList) Test(org.junit.Test)

Aggregations

IntList (org.eclipse.collections.api.list.primitive.IntList)7 MutableList (org.eclipse.collections.api.list.MutableList)5 Lists (org.eclipse.collections.impl.factory.Lists)5 Verify (org.eclipse.collections.impl.test.Verify)5 Assert (org.junit.Assert)5 CharList (org.eclipse.collections.api.list.primitive.CharList)4 Functions (org.eclipse.collections.impl.block.factory.Functions)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Map (java.util.Map)3 Collectors (java.util.stream.Collectors)3 MutableBag (org.eclipse.collections.api.bag.MutableBag)3 PartitionMutableList (org.eclipse.collections.api.partition.list.PartitionMutableList)3 MutableSet (org.eclipse.collections.api.set.MutableSet)3 Predicates2 (org.eclipse.collections.impl.block.factory.Predicates2)3 FingerPrint (il.technion.tinytable.hash.FingerPrint)2 BigDecimal (java.math.BigDecimal)2 BigInteger (java.math.BigInteger)2 Function (org.eclipse.collections.api.block.function.Function)2