Class FlatFileDictionary

java.lang.Object
  extended by FlatFileDictionary
All Implemented Interfaces:
Dictionary

 class FlatFileDictionary
extends java.lang.Object
implements Dictionary


Constructor Summary
FlatFileDictionary()
           
 
Method Summary
 boolean findWord(java.lang.String word)
          This function performs the initialisation required for the "read" and "getMeaning" functions to work properly.
 java.lang.String getDescription()
          The description returned by this function is used by cornucopia at the time of startup to display which dictionary is currently loaded.
 java.lang.String getMeaning()
          This method gives the next meaning string, as signaled by "read" method.
 boolean read()
          This function signals weather another meaning corresponding to the word set by "findWord" function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlatFileDictionary

FlatFileDictionary()
Method Detail

getDescription

public java.lang.String getDescription()
Description copied from interface: Dictionary
The description returned by this function is used by cornucopia at the time of startup to display which dictionary is currently loaded.

Specified by:
getDescription in interface Dictionary
Returns:
String describing the current dictionary implementation.

findWord

public boolean findWord(java.lang.String word)
Description copied from interface: Dictionary
This function performs the initialisation required for the "read" and "getMeaning" functions to work properly. Hence, this must be the first call in the sequence of finding meaning(s) to a word.

Specified by:
findWord in interface Dictionary
Returns:
  • A return value of true indicates that this word is present in the database and its meaning can be retrieved by subsequent calls to read function.
  • A value of false indicated that quried word is not present in database. Cornucopia displays "No match found." on this and suspends any further action.

  • getMeaning

    public java.lang.String getMeaning()
    Description copied from interface: Dictionary
    This method gives the next meaning string, as signaled by "read" method. If called in a proper sequence and at proper time this should never return null.

    Specified by:
    getMeaning in interface Dictionary
    Returns:
    String containing the current meaning.

    read

    public boolean read()
    Description copied from interface: Dictionary
    This function signals weather another meaning corresponding to the word set by "findWord" function. The next meaning can be retrieved by calling the "getMeaning" function.

    Specified by:
    read in interface Dictionary
    Returns:
    It returns a boolean value indicating weather any more meaning(s) are available to be displayed next.