Skip to content

Instantly share code, notes, and snippets.

@arlando
Created February 25, 2013 03:55
Show Gist options
  • Save arlando/5027528 to your computer and use it in GitHub Desktop.
Save arlando/5027528 to your computer and use it in GitHub Desktop.
processing-iterator
/**
* A snippet for an iterator pattern...
*/
import
ArrayList < obj > objs;
void draw() {
Iterator < obj > objsIterator = objs.iterator();
while(objsIterator.hasNext()) {
obj = objsIterator.next()
if(obj.isDead()) {
objsIterator.remove();
} else {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment