Skip to content

Instantly share code, notes, and snippets.

@AtkinsSJ
Created June 2, 2013 11:44
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 AtkinsSJ/5693400 to your computer and use it in GitHub Desktop.
Save AtkinsSJ/5693400 to your computer and use it in GitHub Desktop.
private HashMap<String, String> tracks;
// ...
tracks = new HashMap<String, String>();
tracks.put("Dumb Loop", "track1.svg");
tracks.put("Dumb Loop 2", "track1.svg");
tracks.put("Dumb Loop 3", "track1.svg");
tracks.put("All these are the same", "track1.svg");
// ...
public String[] getTrackNames() {
String[] trackNames = this.tracks.keySet().toArray(new String[0]);
Arrays.sort(trackNames);
return trackNames;
}
public String getTrackFileFromName(String trackName) {
return this.tracks.get(trackName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment