Skip to content

Instantly share code, notes, and snippets.

@companje
Created January 21, 2019 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/2df6d5e9a743639c0acb5f6b05616b33 to your computer and use it in GitHub Desktop.
Save companje/2df6d5e9a743639c0acb5f6b05616b33 to your computer and use it in GitHub Desktop.
ArrayDeque example / FIFO buffer
import java.util.Queue;
import java.util.ArrayDeque;
Queue<String> q = new ArrayDeque();
void setup() {
q.add("a");
q.add("b");
q.add("c");
println(q.poll()); //a
println(q.poll()); //b
println(q.poll()); //c
}
void draw() {
stop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment