java.lang.ObjectTranslation
public class Translation
This class represents the translation of some piece of text into some other language. But the class does not hold any copy of the original text. So its name is a little misleading. It should be called something like TextFragmentInLanguage.
| Field Summary | |
|---|---|
static java.lang.String |
FIELDNAME
this should be dealt with elsewhere such as in the DataFile object |
private java.lang.String |
languageCode
An RFC defined 2 letter language code. |
static java.lang.String |
SEPARATOR
this should be dealt with elsewhere such as in the DataFile object |
private java.lang.String |
translation
|
| Constructor Summary | |
|---|---|
Translation()
|
|
Translation(java.lang.String sDataString)
|
|
Translation(java.lang.String sTranslation,
java.lang.String sLanguageCode)
|
|
| Method Summary | |
|---|---|
java.lang.String |
debug()
|
java.lang.String |
getLanguageCode()
returns a two letter code which represents the human natural language in which this translation is written. |
java.lang.String |
getTranslation()
returns some text |
static void |
main(java.lang.String[] args)
A main method only exists in order to test this class but probably some kind of testing and debugging framework would be less cluttered |
void |
parseDataString(java.lang.String sDataString)
if the data string which is supplied to this method is in a format which the object does not recognize, then the object has a choice; either the object could throw some kind of UnrecognizedDataFormatException or the object could quietly set a flag indicating bad data and return. |
java.lang.String |
print()
provide a textual representation of the data contained by the Translation object. |
void |
setTranslation(java.lang.String sNewTranslation)
|
java.lang.String |
toString()
over-ride the default Object class method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String translation
private java.lang.String languageCode
public static java.lang.String FIELDNAME
public static java.lang.String SEPARATOR
| Constructor Detail |
|---|
public Translation(java.lang.String sTranslation,
java.lang.String sLanguageCode)
public Translation()
public Translation(java.lang.String sDataString)
| Method Detail |
|---|
public void parseDataString(java.lang.String sDataString)
public java.lang.String getTranslation()
public java.lang.String getLanguageCode()
public void setTranslation(java.lang.String sNewTranslation)
public java.lang.String print()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String debug()
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception