Witless
Un blog de actualizaciĆ³n irregular. Irregular updates. Don't hold your breath.
Thursday, April 26, 2012
Iterable interface
Learnt a new thing in Java today:
Given a class:
public class DocumentPreprocessor implements Iterable
> {
...
public Iterator
> iterator()
}
You can use it like this:
for (List
sentence : new DocumentPreprocessor(filename)) { ... }
Which I didn't know. So there you go. Learn a new thing everyday :)
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)