예제 #1
0
 /**
  * Add an entry to the StartList rejecting any duplicate Bib assignments in the same race class It
  * is possible to have the same bib in a different classes in lower levels of races (e.g. C1 and
  * C2)
  *
  * @param racer
  * @param boatClass
  * @throws DuplicateBibException
  */
 public void addBoat(Racer racer, String boatClass) throws DuplicateBibException {
   if (count(racer.getBibNumber(), boatClass) < 1) {
     racers.add(racer);
     startList.add(new BoatEntry(racer, boatClass));
   } else {
     log.error(
         "Can't add bib "
             + racer.getBibNumber()
             + " for "
             + boatClass
             + " "
             + racer.getShortName()
             + " already used by "
             + whoIs(racer.getBibNumber(), boatClass));
     throw new DuplicateBibException();
   }
 }
예제 #2
0
  private boolean sameRun(RaceRun ourRun, RaceRun otherRun) {
    boolean same = false;
    BoatEntry b;
    Racer racer;
    String bib;
    try {
      b = ourRun.getBoat();
      racer = b.getRacer();
      bib = racer.getBibNumber();

      if (bib.compareTo(otherRun.getBoat().getRacer().getBibNumber()) == 0) {
        if (ourRun.getRunNumber() == otherRun.getRunNumber()) {
          same = true;
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return (same);
  }
예제 #3
0
  private boolean sameRun(RaceRun ourRun, PhotoCellRaceRun otherRun) {
    boolean same = false;
    BoatEntry b;
    Racer racer;
    String bib;
    try {
      b = ourRun.getBoat();
      racer = b.getRacer();
      bib = racer.getBibNumber();

      if (bib.compareTo(otherRun.getBibNumber()) == 0) {
        // We only want to store real time Tag Heuer electronic eye times
        // with the current run
        if (ourRun.getRunNumber() == otherRun.getRunNumber()) {
          same = true;
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return (same);
  }