Keep in mind that performance in the JVM is not the same as performance in 
GWT once compiled to JS.

In GWT, if you don't need regexp and only have one separator char, you'd 
probably better use indexOf and substring I guess.
If you need regexps, or have several separators, then using 
com.google.gwt.regexp (in the same way as indexOf) would work and should be 
fast.
…or you could use Guava's Splitter.

On Tuesday, June 24, 2014 3:02:09 PM UTC+2, Boštjan Pajntar wrote:
>
> StringTokenizer is not depracatd though. There is also a good reason for 
> this, as it is quite faster than the split method.
>
> Check a comparison 
> <http://stackoverflow.com/questions/19003055/convert-comma-separated-string-into-a-hashset>
>
>
> Dne petek, 01. avgust 2008 04:48:17 UTC+2 je oseba Kroc napisala:
>>
>> I don't know for this error. 
>>
>> but from javadoc API you can read this: 
>> StringTokenizer is a legacy class that is retained for compatibility 
>> reasons although its use is discouraged in new code. It is recommended 
>> that anyone seeking this functionality use the split  method of String 
>> or the java.util.regex package instead. 
>>
>> So, try other method. 
>> I'm sucessfully using split method. 
>>
>> Vincent 
>>
>> On 1 août, 10:12, Anti <[email protected]> wrote: 
>> > Hello Everybody, 
>> > 
>> > StringTokenizer is very useful but seems I cannot use it in GWT, these 
>> > lines of code: 
>> > 
>> >                         StringTokenizer stringTokenizer = new 
>> > StringTokenizer(sender.getFileName(), "\\"); 
>> >                         while(stringTokenizer.hasMoreTokens()){ 
>> >                                 shortName = 
>> stringTokenizer.nextToken(); 
>> >                         } 
>> > 
>> > throw...: 
>> > 
>> > Line 72:  No source code is available for type 
>> > java.util.StringTokenizer; did you forget to inherit a required 
>> > module? 
>> > 
>> > What can I do? 
>> > 
>> > Thanks.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to