- Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathChatUser.java
More file actions
Latest commit
23 lines (19 loc) · 492 Bytes
/
Copy pathChatUser.java
File metadata and controls
23 lines (19 loc) · 492 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
packageu025;
/**
* Concrete Colleague
* Created by HuGuodong on 12/8/19.
*/
publicclassChatUserextendsUser {
publicChatUser(IChatRoomroom, StringuserId, Stringname) {
super(room, userId, name);
}
@Override
publicvoidsend(Stringmsg, StringtoUserId) {
System.out.printf("%s send message: %s\n", name, msg);
mediator.sendMessage(msg, toUserId);
}
@Override
publicvoidreceive(Stringmsg) {
System.out.println(name + " received: " + msg);
}
}