private String whoIs(String bibNbr, String boatClass) { String who = ""; for (BoatEntry boat : startList) { if (boat.getRacer().getBibNumber().trim().compareTo(bibNbr.trim()) == 0 && boat.getBoatClass().compareTo(boatClass) == 0) { who = boat.getRacer().getBibNumber() + " " + boat.getBoatClass() + " " + boat.getRacer().getShortName(); } } return who; }
public String lookForDuplicateBibsInTheSameClass() { String returnString = null; for (BoatEntry boat : startList) { if (count(boat.getRacer().getBibNumber(), boat.getBoatClass()) > 1) { returnString = "Bib number " + boat.getRacer().getBibNumber() + " occurs more than once in " + boat.getBoatClass(); System.out.println(returnString); log.warn(returnString); } } return (returnString); }
private int count(String bibNbr, String boatClass) { int count = 0; for (BoatEntry boat : startList) { if (boat.getRacer().getBibNumber().trim().compareTo(bibNbr.trim()) == 0 && boat.getBoatClass().compareTo(boatClass) == 0) { count++; } } return count; }