コード例 #1
0
  /**
   * Get all the participants whose results are being tracked.
   *
   * @return set of all participants covered by the resultset.
   */
  public Set<BMRating> getParticipants() {
    // Run through the results and make sure all players have been pushed into the participants set.
    for (BMResult result : results) {
      participants.add(result.getWinner());
      participants.add(result.getLoser());
    }

    return participants;
  }
コード例 #2
0
  /**
   * Get a list of the results for a given player.
   *
   * @param player
   * @return List of results
   */
  public List<BMResult> getResults(BMRating player) {
    List<BMResult> filteredResults = new ArrayList<BMResult>();

    for (BMResult result : results) {
      if (result.participated(player)) {
        filteredResults.add(result);
      }
    }

    return filteredResults;
  }