-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextMessage.java
More file actions
42 lines (31 loc) · 977 Bytes
/
TextMessage.java
File metadata and controls
42 lines (31 loc) · 977 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
41
42
package atChat;
import java.util.ArrayList;
public class TextMessage {
private final String msg;
private final HostConnection.Client[] sendTo;
private final boolean local;
public final HostConnection.Client fromClient;
public TextMessage(String msg, ArrayList<HostConnection.Client> sendTo, HostConnection.Client from) {
this.msg = msg;
this.sendTo = new HostConnection.Client[sendTo.size()];
sendTo.toArray(this.sendTo);
local = false;
fromClient = from;
}
public TextMessage(String msg, ArrayList<HostConnection.Client> sendTo, boolean local, HostConnection.Client from) {
this.msg = msg;
this.sendTo = new HostConnection.Client[sendTo.size()];
sendTo.toArray(this.sendTo);
this.local = local;
fromClient = from;
}
protected boolean isLocal() {
return local;
}
protected String getMsg() {
return msg;
}
protected HostConnection.Client[] getClients() {
return sendTo;
}
}