Package com.iizix.translate
Class Translation
java.lang.Object
com.iizix.translate.Translation
Translation class holding the information processed by the translation engine.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionfinal Throwable
Exception for failure, null otherwise.final String
The original language ID.final String
The original text as passed in to the translator.final KString
The KString as the source text.final boolean
Success flag: the members translatedText, translationLangID can be used (not null).final String
The translated text, null for failure.final String
The translation language ID.final ITranslator
The translator that provided the translation.Constructor Summary
ConstructorDescriptionTranslation
(ITranslator translator, KString sourceText, String originalText, String originalLangID, String translatedText, String translationLangID) Constructs the successful Translation.Translation
(ITranslator translator, KString sourceText, String originalText, String originalLangID, String translationLangID, Throwable exception) Constructs the failed Translation, only from the engine itself.Method Summary
Modifier and TypeMethodDescriptionGets the name of the translator.toString()
The string representation of this class.
Field Details
originalText
The original text as passed in to the translator.originalLangID
The original language ID. If no language is set on translation request, this member will contain what the Translator detected as language. This member may be null when the translation failed.translatedText
The translated text, null for failure.translationLangID
The translation language ID.sourceText
The KString as the source text.translator
The translator that provided the translation.success
public final boolean successSuccess flag: the members translatedText, translationLangID can be used (not null).exception
Exception for failure, null otherwise.
Constructor Details
Translation
public Translation(ITranslator translator, KString sourceText, String originalText, String originalLangID, String translatedText, String translationLangID) Constructs the successful Translation.- Parameters:
translator
- The translator.sourceText
- The KString source text.originalText
- The original text as passed in to the translator.originalLangID
- The original language. If no language is set on translation request, this member will contain what the translation engine detected as language.translatedText
- The translated text.translationLangID
- The translation language.
Translation
public Translation(ITranslator translator, KString sourceText, String originalText, String originalLangID, String translationLangID, Throwable exception) Constructs the failed Translation, only from the engine itself.- Parameters:
translator
- The translator.sourceText
- The KString source text.originalText
- The original text as passed in to the translator.originalLangID
- The original language. If no language is set on translation request, this member will contain what the translation engine detected as language, null if this failed.translationLangID
- The translation language.exception
- The exception.
Method Details