-
Notifications
You must be signed in to change notification settings - Fork 0
/
Contact.java
57 lines (43 loc) · 1.23 KB
/
Contact.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
package com.example.empty.myapplication;
import java.util.Comparator;
public class Contact {
private String name = "";
private String phone_number = "";
private int image = 0;
public Contact(String name, String phone_number, int image) {
this.name = name;
this.phone_number = phone_number;
this.image = image;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone_number() {
return phone_number;
}
public void setPhone_number(String phone_number) {
this.phone_number = phone_number;
}
public int getImage() {
return image;
}
public void setImage(int image) {
this.image = image;
}
@Override
public String toString() {
return name;
}
public static Comparator<Contact> StuNameComparator = new Comparator<Contact>() {
@Override
public int compare(Contact o1, Contact o2) {
String StudentName1 = o1.getName().toUpperCase();
String StudentName2 = o2.getName().toUpperCase();
//ascending order
return StudentName1.compareTo(StudentName2);
}
};
}