Package com.iizix.translate
Class AbstractTranslationRequest
java.lang.Object
com.iizix.translate.AbstractTranslationRequest
- All Implemented Interfaces:
ITranslationRequest
The abstract translation request class.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Class for a RequestItem.Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ArrayList
<AbstractTranslationRequest.RequestItem> Request array.protected final String
The source language code, null for automatic detection.protected final String
The target language code.Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractTranslationRequest
(String sourceLanguageCode, String targetLanguageCode) Constructor.Method Summary
Modifier and TypeMethodDescriptionboolean
addRequest
(KString sourceText, ITranslationReply reply) Adds a requests to perform at the same time as the others.
Field Details
Constructor Details
Method Details
addRequest
Adds a requests to perform at the same time as the others. The amount of simultaneous requests depends on the size of the entire data transaction usually in UTF-8 bytes.- Specified by:
addRequest
in interfaceITranslationRequest
- Parameters:
sourceText
- The source text to translate.reply
- The reply callback when translation completes.- Returns:
- true for successfully added, false for no more room.