Package com.example.server.client
Interface ChatInterface
- All Known Implementing Classes:
ChatClientsHashMap
public interface ChatInterface
Interface for working with chat clients
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addUser
(ChatClient client) Add new user to the chatvoid
clear()
Clen whole listboolean
containsUser
(String nickname) Check if client is in the chatint
Count all users in the chatReceive the list of all clients in current chatSearch and return user from chatvoid
removeUser
(String nickname) Remove user from the chat
-
Method Details
-
addUser
Add new user to the chat- Parameters:
client
- new client
-
removeUser
Remove user from the chat- Parameters:
nickname
- name of definite client to remove
-
containsUser
Check if client is in the chat- Parameters:
nickname
- name of definite client to search for- Returns:
- true if such client is in the chat
-
getUser
Search and return user from chat- Parameters:
nickname
- use client`s nickname to search- Returns:
- client from the current chat
-
getAllUsers
Collection<ChatClient> getAllUsers()Receive the list of all clients in current chat- Returns:
- collection of all clients
-
countUsers
int countUsers()Count all users in the chat- Returns:
- total number of clients in chat
-
clear
void clear()Clen whole list
-