data
Class Worddatabase

java.lang.Object
  extended by data.Worddatabase
All Implemented Interfaces:
java.lang.Runnable

public class Worddatabase
extends java.lang.Object
implements java.lang.Runnable

This class represents the worddatabase and provides methods for searching it.

See Also:
Runnable

Field Summary
 Launcher launcher
           
 LoadingDatabase load
           
private  int NUMBER_OF_RESULTS
           
private  org.dom4j.Element root
           
private  java.lang.String searchString
           
 
Constructor Summary
Worddatabase(Launcher launcher)
          The constructor creates a document object containing the XML content of the worddatabase.
 
Method Summary
 void findWords(java.lang.String word)
          Used to search words in the database.
 void run()
          This is executed when starting a new thread.
 void setRootElement(org.dom4j.Element root)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_OF_RESULTS

private final int NUMBER_OF_RESULTS
See Also:
Constant Field Values

load

public LoadingDatabase load

launcher

public Launcher launcher

searchString

private java.lang.String searchString

root

private org.dom4j.Element root
Constructor Detail

Worddatabase

public Worddatabase(Launcher launcher)
The constructor creates a document object containing the XML content of the worddatabase. This serves as a base for searching against the user input.

Parameters:
Launcher - launcher - the parent class, used to reference the GUI objects
Method Detail

findWords

public void findWords(java.lang.String word)
Used to search words in the database. This is a method which starts a separate thread to find matches against a search String. A second thread is needed to kepp the app accessible during searches.

Parameters:
String - word The word to search for as regular expression to be matched. For unknown letters '.' has to be used.

run

public void run()
This is executed when starting a new thread. Invoked by the "findWords" method to search the worddatabase within a new thread.

Specified by:
run in interface java.lang.Runnable

setRootElement

public void setRootElement(org.dom4j.Element root)