-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeamSorter.java
More file actions
68 lines (59 loc) · 1.4 KB
/
TeamSorter.java
File metadata and controls
68 lines (59 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
/**
* This class handles the sort functions for the Leagues, using the collections.sort method.
* @author oscarfilson
*/
public class TeamSorter {
ArrayList<Team> teams = new ArrayList<>();
/**
* Makes a new TeamSorter
* @param ArrayList<Team> - teams
*/
public TeamSorter(ArrayList<Team> teams) {
this.teams = teams;
}
/**
* Sorts by the total wins a team has
*/
public void sortByActualWins() {
Collections.sort(teams, Team.normalComparator);
}
/**
* Sorts by the adjusted wins a team has
*/
public void sortByAdjustedWins() {
Collections.sort(teams, Team.adjustedComparator);
}
/**
* Sorts by the momentum wins a team has
*/
public void sortByMomentumWins() {
Collections.sort(teams, Team.momentumComparator);
}
/**
* Sorts by the stats wins a team has
*/
public void sortByStatsWins() {
Collections.sort(teams, Team.statsComparator);
}
/**
* Sorts by the the name of the team alphabetically
*/
public void sortByName() {
Collections.sort(teams, Team.nameComparator);
}
/**
* Sorts by the player wins a team has
*/
public void sortByPlayerWins() {
Collections.sort(teams, Team.playerComparator);
}
/**
* Sorts by the Strength of Schedule wins a team has
*/
public void sortBySoSWins() {
Collections.sort(teams, Team.scheduleComparator);
}
}