Re: generators in Java?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: generators in Java?

From: Diez B. Roggisch <deets@nospam.web.de>
Date: Sat Dec 31 2005 - 10:44:49 CET

Tom Sheffler schrieb:
>
> This may have been discussed before, so I apologize.
>
> Does Java have generators? I am aware of the "Iterator" interface,
> but it seems much more restrictive. Python generators are useful
> for many more things than simply list enumeration, but the Java
> Iterator seems limited.

No, it hasn't. One thing people do is to create threads that communicate
via a queue and block while that queue has an item in it. But of course
that comes at additional overhead of thread context switching.

Regards,

Diez
Received on Tue Jan 3 03:28:47 2006