Class AbstractTranslationRequest

java.lang.Object
com.iizix.translate.AbstractTranslationRequest
All Implemented Interfaces:
ITranslationRequest

public abstract class AbstractTranslationRequest extends Object implements ITranslationRequest
The abstract translation request class.
Author:
Christopher Mindus
  • Field Details Link icon

    • requests Link icon

      Request array.
    • sourceLanguageCode Link icon

      protected final String sourceLanguageCode
      The source language code, null for automatic detection.
    • targetLanguageCode Link icon

      protected final String targetLanguageCode
      The target language code.
  • Constructor Details Link icon

    • AbstractTranslationRequest Link icon

      protected AbstractTranslationRequest(String sourceLanguageCode, String targetLanguageCode)
      Constructor.
      Parameters:
      sourceLanguageCode - The source language code, null for automatic detection.
      targetLanguageCode - The target language code.
  • Method Details Link icon

    • addRequest Link icon

      public boolean addRequest(KString sourceText, ITranslationReply reply)
      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 interface ITranslationRequest
      Parameters:
      sourceText - The source text to translate.
      reply - The reply callback when translation completes.
      Returns:
      true for successfully added, false for no more room.