All pastes #2388 Raw Edit

Anonymous

public text v1 · immutable
#2388 ·published 2004-11-26 22:28 UTC
rendered paste body
public 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;
    }