-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserProfile.java
More file actions
105 lines (87 loc) · 2.57 KB
/
Copy pathUserProfile.java
File metadata and controls
105 lines (87 loc) · 2.57 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
package database2;
public class UserProfile extends GenData implements User {
private String ID,email,pass;
LinkedList groups,current,created;
GroupTree tree=MainActivity.test;//when we get a data base we will make tree call the database function get tree.
public UserProfile(String Id, String Email, String Password){
setId(Id);
setEmail(Email);
setPass(Password);
groups= new LinkedList("myGroups");
}
@Override
public boolean addToGroup(String group) {
current=tree.getGroup(group);
if(current!=null){
current.add(this);
groups.add(current);
return true;
}
return false;
}
@Override
public boolean isMember(String group) {
current=tree.getGroup(group);
if(current!=null){
return groups.contains(current);
}
return false;
}
@Override
public boolean removeFromGroup(String group) {
current=tree.getGroup(group);
if(current!=null){
current.remove(this);
groups.remove(current);
return true;
}
return false;
}
@Override
public LinkedList GetGroups() {
return groups;
}
@Override
public LinkedList GetCreatedGroups() {
return created;
}
@Override
public boolean createGroup(String name,String sub) {
return tree.addGroup(name,sub);
}
@Override
public boolean removeGroup(String name) {
return false;
}
//-----------------------------------------------------------------------------------------------------------------------------------+
// Get and Set Methods |
//-----------------------------------------------------------------------------------------------------------------------------------+
@Override
public void setId(String Id){
this.ID=Id;
}
@Override
public String getId(){
return ID;
}
@Override
public void setEmail(String email){
this.email=email;
}
@Override
public String getEmail(){
return email;
}
@Override
public void setPass(String password){
this.pass=password;
}
@Override
public String getPass(){
return pass;
}
@Override
public String toString(){
return "( " + ID + ", " + email +" )\n";
}
}