Пример #1
0
 public List<SeasonalTeam> getSeasonalTeams() {
   List<SeasonalTeam> seasonalTeams = new ArrayList<SeasonalTeam>();
   for (SeasonalAthlete a : getAllSeasonalAthletes()) {
     if (!ObjectUtils.isBlank(a) && !ObjectUtils.isBlank(a.getTeam())) {
       seasonalTeams.add(a.getTeam());
     }
   }
   return seasonalTeams;
 }
Пример #2
0
  public List<Integer> getYearsPlayed() {

    List<Integer> yearsPlayed = new ArrayList<Integer>();
    for (SeasonalAthlete sa : getAllSeasonalAthletes()) {
      if (!yearsPlayed.contains(sa.getYear())) {
        yearsPlayed.add(sa.getYear());
      }
    }
    Collections.sort(yearsPlayed);
    Collections.reverse(yearsPlayed);
    return yearsPlayed;
  }
Пример #3
0
    public Object calculateStat(String stat, SeasonalAthlete seasonalAthlete, String aggregator) {
      Object ret = null;
      if (SortParam.GAMES_PLAYED.fieldName.equalsIgnoreCase(stat)) {
        ret = calculateGamesPlayed(seasonalAthlete);
        ret = convertToNumber(ret, Integer.class);
      } else if (SortParam.LAST_NAME.fieldName.equalsIgnoreCase(stat)) {
        ret = calculateAthleteLastName(seasonalAthlete);
      } else if (SortParam.FIRST_NAME.fieldName.equalsIgnoreCase(stat)) {
        ret = calculateAthleteFirstName(seasonalAthlete);
      } else if (AVG.equalsIgnoreCase(aggregator)) {
        ret = seasonalAthlete.averageStat(stat, predicate);
        ret = convertToNumber(ret, Double.class);
      } else {
        ret = seasonalAthlete.sumStat(stat, predicate);
        ret = convertToNumber(ret, Integer.class);
      }

      return ret;
    }
Пример #4
0
    public Object calculateGamesPlayed(SeasonalAthlete seasonalAthlete) {
      Object ret = seasonalAthlete.getEventsPlayedCount(predicate);

      return convertToNumber(ret, Integer.class);
    }
Пример #5
0
 public Object calculateSchoolName(SeasonalAthlete seasonalAthlete) {
   return seasonalAthlete.getAthlete().getSchool().getName();
 }
Пример #6
0
 public Object calculateAthleteFirstName(SeasonalAthlete seasonalAthlete) {
   return seasonalAthlete.getAthlete().getFirstName();
 }