I'm looking for an efficient way to obtain a list of String tokens extracted from multiple Strings (e.g. with a whitespace separator).
Example:
String s1 = "My mom cook everyday";
String s2 = "I eat everyday";
String s3 = "Am I fat?";  
LinkedList<String> tokens = new LinkedList<String>();   
//any code to efficiently get the tokens
//final result is tokens  make of a list of the following tokens:
//"My", "mom", "cook", "everyday", "I", "eat", "everyday", "Am", "I", "fat?".
Now
- I'm not sure that LinkedListis the most effective collection class to be used (Apache Commons, Guava, may they help?)!
- I was going to use StringUtilsfrom Apache Commons, but thesplitmethod returns an array! So, I should extract with a for cycle the Strings from the array of String objects returned by split. Is that efficient: I don't know,splitcreates an array!
- I read about Splitterfrom Guava, but this post states thatStringUtilsis better in practice.
- What about ScannerfromJava.util. It seems to not allocate any additional data structures. Isn't it?
Please, draw the most efficient Java solution, even by using additional widely used library, like Guava and Apache Commons.
 
     
     
     
     
     
     
    