java.lang.Object
test.DictionaryCommunication
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIfWordValid(String word) The checkIfWordValid function takes in a String word and checks if it is valid.voidclose()The close function closes the server socket.static DictionaryCommunicationThe getInstance function is a singleton function that returns the same instance of DictionaryCommunication every time it is called.
-
Method Details
-
checkIfWordValid
The checkIfWordValid function takes in a String word and checks if it is valid.- Parameters:
word- Send the word to the server- Returns:
- True if the word is valid, false otherwise
-
close
public void close()The close function closes the server socket. -
getInstance
The getInstance function is a singleton function that returns the same instance of DictionaryCommunication every time it is called. This allows for multiple classes to use the same instance of DictionaryCommunication, and thus access the same dictionary.- Returns:
- An instance of the dictionarycommunication class
-