Skip to content

Instantly share code, notes, and snippets.

@jorgenpt
Last active December 13, 2015 16:49
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 jorgenpt/4942902 to your computer and use it in GitHub Desktop.
Save jorgenpt/4942902 to your computer and use it in GitHub Desktop.
public <T> Bag<T> register(Class<T extends Node> klass) {
Bag<T> list = (Bag<T>)nodes.get(klass);
if(list == null) {
list = new Bag<T>();
nodes.put(klass, list);
}
return list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment