All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Entity.Translation

java.lang.Object
   |
   +----java.util.Dictionary
           |
           +----java.util.Hashtable
                   |
                   +----Entity.Translation

public class Translation
extends Hashtable
The class for obtaining word translation from the dictionaries


Constructor Index

 o Translation(String, String)
The constructor for Translation This will construct a new dictionary based on the passed primary and secondary languages

Method Index

 o addWord(String, String)
This method will Add a new word and its translation to the dictionary
 o getTranslation(String)
This method will return the primary language translation of given word
 o noWords()
This method will Return true if there are no words in the dictionary
 o numberWords()
This method will Return the count of words in the dictionary

Constructors

 o Translation
 public Translation(String slang,
                    String plang)
The constructor for Translation This will construct a new dictionary based on the passed primary and secondary languages

Parameters:
String - The secondary language
String - The primary language
Returns:
none

Methods

 o getTranslation
 public String getTranslation(String word)
This method will return the primary language translation of given word

Parameters:
String - the word to be translated
Returns:
String the translated word(s) in the primary language
 o addWord
 public void addWord(String sword,
                     String pword)
This method will Add a new word and its translation to the dictionary

Parameters:
String - The secondary language word
String - The translation word(s) in primary language
Returns:
none
 o numberWords
 public int numberWords()
This method will Return the count of words in the dictionary

Returns:
int Number of words
 o noWords
 public boolean noWords()
This method will Return true if there are no words in the dictionary

Returns:
boolean No words

All Packages  Class Hierarchy  This Package  Previous  Next  Index