Interface ChatInterface

All Known Implementing Classes:
ChatClientsHashMap

public interface ChatInterface
Interface for working with chat clients
  • Method Details

    • addUser

      void addUser(ChatClient client)
      Add new user to the chat
      Parameters:
      client - new client
    • removeUser

      void removeUser(String nickname)
      Remove user from the chat
      Parameters:
      nickname - name of definite client to remove
    • containsUser

      boolean containsUser(String nickname)
      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

      ChatClient getUser(String nickname)
      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