-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSportsClub.java
More file actions
100 lines (81 loc) · 2.3 KB
/
Copy pathSportsClub.java
File metadata and controls
100 lines (81 loc) · 2.3 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import java.io.Serializable;
public abstract class SportsClub implements Serializable {
private String clubName;
private Address clubLocation;
private int numOfWins;
private int numOfDraws;
private int numOfDefeats;
private int points;
private int numOfMatchPlayed;
private static int numOfClubs;
/*default constructor*/
public SportsClub(){
this.clubName = null;
this.clubLocation = null;
this.numOfWins = 0;
this.numOfDraws = 0;
this.numOfDefeats = 0;
this.points = 0;
this.numOfMatchPlayed = 0;
numOfClubs++;
}
public SportsClub(String clubName, Address clubLocation){
this.clubName = clubName;
this.clubLocation = clubLocation;
}
public String getClubName(){
return this.clubName;
}
public void setClubName(String clubName){
this.clubName = clubName;
}
public Address getClubLocation(){
return this.clubLocation;
}
public void setClubLocation(Address clubLocation){
this.clubLocation = clubLocation;
}
public int getNumOfWins(){
return this.numOfWins;
}
public void setNumOfWins(){
this.numOfWins++;
}
public int getNumOfDraws(){
return this.numOfDraws;
}
public void setNumOfDraws(){
this.numOfDraws++;
}
public int getNumOfDefeats(){
return this.numOfDefeats;
}
public void setNumOfDefeats(){
this.numOfDefeats++;
}
public int getNumOfMatchPlayed(){
return this.numOfMatchPlayed;
}
public void setNumOfMatchPlayed(){
this.numOfMatchPlayed++;
}
public int getPoints(){
return this.points;
}
public void setPoints(int points){
this.points += points;
}
public static int getNumOfClubs(){
return numOfClubs;
}
@Override
public String toString(){
return "Club Name: "+this.getClubName()+"\n"
+this.getClubLocation()+"\n"
+"Num of Wins: "+this.getNumOfWins()+"\n"
+"Num of Draws: "+this.getNumOfDraws()+"\n"
+"Num of Defeats: "+this.getNumOfDefeats()+"\n"
+"Num of Played: "+this.getNumOfMatchPlayed()+"\n"
+"Points: "+this.getPoints()+"\n";
}
}