Skip to content

Instantly share code, notes, and snippets.

@hfaulds
Created January 15, 2012 21:21
Show Gist options
  • Select an option

  • Save hfaulds/1617390 to your computer and use it in GitHub Desktop.

Select an option

Save hfaulds/1617390 to your computer and use it in GitHub Desktop.
public void render(final GL2 gl) {
ArrayUtils.map(elements, new MapFunction<OctNode>(){
public void map(OctNode input) {
input.render(gl);
}
}
);
}
public class ArrayUtils{
public static <T> void map(T[] array, MapFunction<T> function) {
for(T item : array)
function.map(item);
}
}
public abstract class MapFunction<T> {
public abstract void map(T input);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment