Anonymous
public text v1 · immutablepublic ArrayList<String> getRounds(String golferName, Date date) {
ArrayList<Round> selected = new ArrayList<Round>();
ArrayList<String> output = new ArrayList<String>();
int roundCount = 0;
for (Round r: rounds) {
if ( roundCount == 20 ) {
break;
}
if ( r.getName().equals(golferName) && ( r.getDate().compareTo(date) < 0 || r.getDate().compareTo(date) == 0 )) {
selected.add(r);
}
roundCount++;
}
Collections.sort(selected);
return output;
}