-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfo.java
More file actions
89 lines (76 loc) · 1.73 KB
/
Info.java
File metadata and controls
89 lines (76 loc) · 1.73 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
import java.util.LinkedList;
public class Info {
/**
* classe che contiene le informazione generiche di un progetto
*/
/**
* nome del progetto
*/
private String name;
/**
* indirizzo ip multicast utilizzato per la chat del progetto
*/
private String address;
/**
* lista dei membri appartenenti al progetto
*/
private LinkedList<String> members;
public Info() {
super();
}
/**
*
* @param _name nome del progetto
* @param _creator username del creatore del progetto
*/
public Info(String _name, String _creator) {
this.name = _name;
this.address = RandMulticastAddress.getMulticastAddress();
this.members = new LinkedList<String>();
this.members.add(_creator);
}
/*
public Info(String _name, String _address, LinkedList<String> _members) {
this.name = _name;
this.address = _address;
this.members = _members;
}
*/
/**
*
* @return restituisce una stringa contenente il nome del progetto
*/
public String getName() {
return this.name;
}
/**
* restituisce una stringa contenente l'indirizzo multicast del progetto
*/
public String getAddress() {
return this.address;
}
/**
* restituisce la lista dei membri appartenenti al progetto
*/
public LinkedList<String> getMembers() {
return this.members;
}
/**
* aggiunge l'utente alla lista dei membri del gruppo
* @param name username dell'utente
*/
public void addMember(String name) {
this.members.add(name);
}
/**
* verifica se l'utente è un membro del progetto
* @param name username dell'utente
* @return true se l'utente è già un membro del progetto, false altrimenti
*/
public boolean containsMember(String name) {
if(this.members.contains(name))
return true;
else
return false;
}
}