Class DictionaryDAO

java.lang.Object
com.example.project.services.sqlite.dAOs.DictionaryDAO

public class DictionaryDAO extends Object
The SQLite Dictionary. The connection returned from SQLiteDictionaryConnection().getInstance() is always the same.
  • Constructor Details

    • DictionaryDAO

      public DictionaryDAO()
      Constructor for this class SQLLiteDictionary.
    • DictionaryDAO

      public DictionaryDAO(Connection connection, Logger logger)
      constructor with injection for tests.
      Parameters:
      connection - mock connection.
      logger - a mock logger.
  • Method Details

    • getWordDefinition

      public String getWordDefinition(String wordToFind)
      gets the words definition.
      Parameters:
      wordToFind - Word to get definition of.
      Returns:
      Returns the definition.
    • isWordInDictionary

      public boolean isWordInDictionary(String wordToCheck)
      gets if word is in dictionary.
      Parameters:
      wordToCheck - Word to check.
      Returns:
      returns the boolean value indicating whether the word exists in our database.