Example - Collect

I. Task
Use collect to find all categories of an input

II. Notes

  • Java 7 - mutation
  • Java 8 -
    • collect (joining(", "))
    • collect (stoList())

III. Java Codes

IV. Results

----- Program Starts ... 
----- GetInflVarList8( ): -----
--- input file: ../data/inflVars.data
--- Total lines: 1690181
== input term: left
===== Ex4_Collector.Test (1) =====
== input term (left): adj, adv, noun, verb
-- Time (Java 7 - collect): 0.214062418
== input term (left): [adj, adv, noun, verb]
-- Time (Java 8 - Collector): 0.152612463
== input term (left): adjadvnounverb
== Categories (8 - StringBuilder): 0.112986113
== input term (left): adj, adv, noun, verb
== Categories (8 - joining): 0.127256659
== input term (left): adj, adv, noun, verb
== Categories (8 - joining, parallel): 0.134598772
----- Program Ends ...