scala-collections
Scala: How to create a Map[K,V] from a Set[K] and a function from K to V?
What is the best way to create a Map[K,V] from a Set[K]开发者_JAVA技巧 and function from K to V?[详细]
2023-02-23 07:20 分类:问答How to assign an order for TreeSet in Scala without repeating myself
I have this segment of Scala code which defines an orderi开发者_JS百科ng and applies it to a TreeSet.This part compiles fine.[详细]
2023-02-20 08:21 分类:问答scala parallel collections degree of parallelism
Is there any equivalent in scala parallel collections to LINQ\'s withDegreeOfParallelism which sets the number of threads which will run a query? I want to run an operation in parallel which needs to[详细]
2023-02-20 03:27 分类:问答Difference between MutableList and ListBuffer
What is the diffe开发者_运维百科rence between Scala\'s MutableList and ListBuffer classes in scala.collection.mutable? When would you use one vs the other?[详细]
2023-02-19 19:50 分类:问答Stream vs Views vs Iterators
What are the differences among Streams, View开发者_StackOverflows (SeqView), and Iterators in scala? This is my understanding:[详细]
2023-02-14 00:27 分类:问答Why += doesn't work with Lists?
Although I know that there are more idomatic ways of doing this, why doesn\'t this code work? (Mostly, why doesn\'t the first attempt at just x += 2 work.) Are these quite peculiar looking (for a newc[详细]
2023-02-13 14:03 分类:问答Mixing in generic traits in parameterized classes without duplicating type parameters
Let\'s assume I want to create a trait that I can mix in into any Traversable[T]. In the end, I want to be able to say things like:[详细]
2023-02-12 02:44 分类:问答Scala SortedSet - sorted by one Ordering and unique by something else?
Say I have a set of Strings that I want to开发者_Go百科 be ordered by length but unique by the normal String uniqueness. What I mean is that I that I could have more than one String of same length in[详细]
2023-02-09 09:18 分类:问答Use java.util.Map from Scala
I need to use java-legacy code with the following method: public void doit(Map <String, Object> vals) {...}[详细]
2023-02-08 17:04 分类:问答Scala Convert Set to Map
How do I convert a Set(\"a\",\"b\",\"c\") to a Map(\"a\"-开发者_如何学Python>1,\"b\"->2,\"c\"->3)?[详细]
2023-02-08 04:17 分类:问答