show goals > num
This commit is contained in:
@@ -39,6 +39,16 @@ public class PlayerList {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PlayerList getPlayersGoalsAbove(int num) {
|
||||||
|
PlayerList newList = new PlayerList();
|
||||||
|
for (HockeyPlayer p : PlayerList) {
|
||||||
|
if (p.getGoals() > num) {
|
||||||
|
newList.addPlayer(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newList;
|
||||||
|
}
|
||||||
|
|
||||||
public void sortByNames() {
|
public void sortByNames() {
|
||||||
for (int i = 0; i < pList.size(); i++) {
|
for (int i = 0; i < pList.size(); i++) {
|
||||||
boolean swapped = false;
|
boolean swapped = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user