-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMember.java
87 lines (73 loc) · 1.77 KB
/
Member.java
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
/*
* Student name: Ross Petridis
* Student ID: 1080249
* LMS username: rpetridis
*/
import java.io.Serializable;
/**
* Mebmer class for keeping track of members' data and the links to other data
* assocaited data sourcecs, such as a bill or entry.
* such as bills and entry
*
* @author Ross Petridis
*/
public class Member implements Serializable {
private String ID;
private String name;
private String address;
/**
* Standard cnstructor for when reading members from file
*
* @param ID the member ID
* @param name the name of the member
* @param address their address
*/
public Member(String ID, String name, String address) {
this.ID = ID;
this.name = name;
this.address = address;
}
/**
* Creates a safe copy of a member.
*
* @param member
*/
public Member(Member member) {
this.ID = member.ID;
this.name = member.name;
this.address = member.address;
}
/**
*
* @param ID ID to comapre with
* @return true iff this member has this ID..
*/
public boolean hasID(String ID) {
return (this.ID.equals(ID));
}
public void setMemberID(String id) {
this.ID = id;
}
public String getAdress() {
return address;
}
public void setName(String name) {
this.name = name;
}
public void setAdress(String address) {
this.address = address;
}
/**
* Overriding of default toString to make it more useful
*/
@Override
public String toString() {
return ("Member ID: " + ID + ", Member Name: " + name);
}
public String getMemberID() {
return ID;
}
public String getMemberName() {
return name;
}
}