February 2014
Beginner
1248 pages
62h 25m
English
• Files method lines creates a Stream<String> for reading the lines of text from a file.
• Stream method flatMap (p. 760) receives a Function that maps an object into a stream—e.g., a line of text into words.
• Pattern method splitAsStream (p. 760) uses a regular expression to tokenize a String.
• Collectors method groupingBy with three arguments receives a classifier, a Map factory and a downstream Collector. The classifier is a Function that returns objects which are used as keys in the resulting Map. The Map factory is an object that implements interface Supplier and returns a new Map collection. The downstream Collector determines how to collect each group’s elements.
• Map method entrySet ...
Read now
Unlock full access