-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContactImpl.java
More file actions
40 lines (35 loc) · 841 Bytes
/
ContactImpl.java
File metadata and controls
40 lines (35 loc) · 841 Bytes
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
/**
* This class will need to contain methods to read data
* input from a tab-delimited text file. This could also
* take place via a 'reader' class that will parse the
* ident ints etc.
* <p>
* Each line/row should represent an instance of ContactImpl,
* and each column should represent a member field.
*/
public class ContactImpl implements Contact {
private final String name;
private final int ident;
private String notes;
public ContactImpl(String name, int ident){
this.name = name;
this.ident = ident;
this.notes = null;
}
public int getId(){
return this.ident;
}
public String getName(){
return this.name;
}
public String getNotes(){
return this.notes;
}
public void addNotes(String note){
if (this.notes == null){
this.notes = note;
} else {
this.notes += ", " + note;
}
}
}