-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMember.java
More file actions
178 lines (175 loc) · 3.93 KB
/
Member.java
File metadata and controls
178 lines (175 loc) · 3.93 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/**
* A class representing a library member.
*
* @author Joshua
* @version 1.0
*/
public class Member {
private int memberId;
private String firstName;
private String lastName;
private String phone;
private boolean resident;
// actually this could be more than just late fees
private double lateFeesDue;
private int booksOut;
/**
* Member Constructor
*
* @param memberId
* The Id of the member
*
* @param firstName
* The member's first name
* @param lastName
* The member's last name
* @param phone
* the members phone number: preferred format = (111)-222-3333
*
* @param resident
* A boolean signifying whether the member is a resident of the area
*
* @param lateFeesDue
* The fees the member currently owes
*
* @param booksOut
* The books the member is currently borrowing
*/
public Member(int memberId, String firstName, String lastName, String phone, boolean resident, double lateFeesDue, int booksOut)
{
this.memberId = memberId;
this.firstName = firstName;
this.lastName = lastName;
this.phone = phone;
this.resident = resident;
this.lateFeesDue = lateFeesDue;
this.booksOut = booksOut;
}
/**
* Gets the member id of the Member Object.
*
* @return The member's Id
*/
public int getMemberId() {
return memberId;
}
/**
* Sets the member id of the Member Object.
*
* @param memberId
* The Id you wish to assign to this Member Object
*/
public void setMemberId(int memberId) {
this.memberId = memberId;
}
/**
* Gets the first name of the Member Object.
*
* @return The member's first name
*/
public String getFirstName() {
return firstName;
}
/**
* Sets the first name of the Member Object.
*
* @param firstName
* The first name you wish to assign to this Member Object
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* Gets the last name of the Member Object.
*
* @return The member's last name
*/
public String getLastName() {
return lastName;
}
/**
* Sets the last name of the Member Object.
*
* @param lastName
* The last name you wish to assign to this Member Object
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* Gets the phone number of the Member Object.
*
* @return The member's phone number
*/
public String getPhone() {
return phone;
}
/**
* Sets the phone number of the Member Object.
*
* @param phone
* The phone number you wish to assign to this Member Object
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* Gets a boolean signifying whether the Member Object is a resident.
*
* @return whether the member is a resident
*/
public boolean isResident()
{
return resident;
}
/**
* Sets a boolean signifying whether the Member Object is a resident.
*
* @param resident
* The resident value you wish to assign to this Member Object
*/
public void setResident(boolean resident)
{
this.resident = resident;
}
/**
* Gets the late fees due for the Member Object.
*
* @return The fees the member owes
*/
public double getLateFeesDue() {
return lateFeesDue;
}
/**
* Sets the late fees due for the Member Object.
*
* @param lateFeesDue
* The fees owed you wish to assign to this Member Object
*/
public void setLateFeesDue(double lateFeesDue) {
this.lateFeesDue = lateFeesDue;
}
/**
* Get the number of books out for the Member Object.
*
* @return The number of books a member has out
*/
public int getBooksOut() {
return booksOut;
}
/**
* Set the number of books out for the Member Object.
*
* @param booksOut
* The number of books out you wish to assign to this Member Object
*/
public void setBooksOut(int booksOut) {
this.booksOut = booksOut;
}
/**
* A generic toString() method
*/
public String toString() {
return "" + memberId + " " + firstName + " " + lastName + " " + phone + " " + lateFeesDue + " " + booksOut;
}
}