EasyTalk
Class SearchScreen

java.lang.Object
  extended by Form
      extended by EasyTalk.SearchScreen
Direct Known Subclasses:
CategoricalSearchScreen, GeneralSearchScreen, PhraseResultsScreen

public class SearchScreen
extends Form

SearchScreen is the base class of the EasyTalk Screens. GeneralSearchScreen, PhraseResultsScreen, and CategoricalSearchScreen inherit from SearchScreen. SearchScreen contains the key methods for translation.


Field Summary
protected  java.lang.String[] languages
           
protected  java.lang.String[] naturalLanguages
           
 
Constructor Summary
SearchScreen(java.lang.String str)
           
 
Method Summary
protected  java.lang.String getHTML(java.lang.String address)
          Read file
protected  java.lang.String[] getLanguages(int id)
          getLanguages(int) receives a language id number and returns an array of strings containing the list of languages in the language corresponding the id number.
protected  java.lang.String[] parseLanguages(java.lang.String s)
          parseLangues(String) parses a string of languages and puts them in an array.
protected  java.lang.String translateText(java.lang.String phrase, int from, int to)
          translateText(String, int, int) translates the text via the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

languages

protected java.lang.String[] languages

naturalLanguages

protected java.lang.String[] naturalLanguages
Constructor Detail

SearchScreen

public SearchScreen(java.lang.String str)
Method Detail

getLanguages

protected java.lang.String[] getLanguages(int id)
getLanguages(int) receives a language id number and returns an array of strings containing the list of languages in the language corresponding the id number.

Parameters:
id, - the language id received
Returns:
array , the String array of languages

parseLanguages

protected java.lang.String[] parseLanguages(java.lang.String s)
parseLangues(String) parses a string of languages and puts them in an array.

Parameters:
s - , the string array of languages.
Returns:
array , the parsed array of languages.

getHTML

protected java.lang.String getHTML(java.lang.String address)
                            throws java.io.IOException
Read file

Parameters:
address - , the web address of the HTML document.
Returns:
str , the HTML from the document.
Throws:
java.io.IOException

translateText

protected java.lang.String translateText(java.lang.String phrase,
                                         int from,
                                         int to)
translateText(String, int, int) translates the text via the database. If the phrase cannot be found it goes to the online translation.

Parameters:
phrase - , the phrase to be translated.
from - , the language the phrase is translated from.
to - , the language the phrase is being translated to.
Returns:
s , the translated string.