You can use
c map (t => t.getP -> t) toMap
but be aware that this needs 2 traversals.
More Related Contents:
- Scala 2.8 breakOut
- Is the Scala 2.8 collections library a case of “the longest suicide note in history”? [closed]
- Why is Scala’s immutable Set not covariant in its type?
- What is the difference between JavaConverters and JavaConversions in Scala?
- When should I choose Vector in Scala?
- What does param: _* mean in Scala?
- Scala 2.8 collections design tutorial
- withFilter instead of filter
- What type to use to store an in-memory mutable data table in Scala?
- Scala Map implementation keeping entries in insertion order?
- When to use parenthesis in Scala infix notation
- Stream vs Views vs Iterators
- How to read files from resources folder in Scala?
- Function returns an empty List in Spark
- Scala: Why does Seq.contains take an Any argument, instead of an argument of the sequence type?
- Reduce, fold or scan (Left/Right)?
- How do I make a function involving futures tail recursive?
- Use functional combinators on Scala Tuples?
- Scala Sets contain the same elements, but sameElements() returns false
- Difference between MutableList and ListBuffer
- Scala: Parallel collection in object initializer causes a program to hang
- How can I convert immutable.Map to mutable.Map in Scala?
- scala parallel collections degree of parallelism
- Spark extracting values from a Row
- Escape a dollar sign in string interpolation
- Explicit self-references with no type / difference with ”this”
- Limits of Nat type in Shapeless
- Using partial functions in Scala – how does it work?
- Spark Dataframe Random UUID changes after every transformation/action
- Multiline function literal as arguments in Scala