Menu

#47 Use Java Iterable and Iterator

Enhancement
open
nobody
5
2017-12-27
2017-12-27
Rijk
No

Use of the Java Iterator and Iterable interfaces can simplify the jMusic API's considerably. E.g. Phrase.addNoteList:
public void addNoteList(Note... notes) {
for(Note note : notes) {
this.addNote(notes);
}
}
doesn't need the counting for-loop when using the Iterable interface, making the code easier to read. The Iterator also replaces the now obsolete Enumeration.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB