textmaven.application.translator.writer
Class AbstractTranslationWriter

java.lang.Object
  extended bytextmaven.application.translator.writer.AbstractTranslationWriter
All Implemented Interfaces:
ITranslationWriter
Direct Known Subclasses:
AbstractHTMLWriter, LITDictionaryXMLWriter, VocabularyTrainerWriter

public abstract class AbstractTranslationWriter
extends java.lang.Object
implements ITranslationWriter

Author:
krebtho

Field Summary
protected  java.lang.String mBook
           
protected  int mSentences
           
 
Fields inherited from interface textmaven.application.translator.writer.ITranslationWriter
NO_TRANSLATION
 
Constructor Summary
AbstractTranslationWriter()
           
 
Method Summary
 java.lang.String formatTranslation(java.lang.String aTranslation)
           
 java.lang.String getBookTitle()
          Returns bool title
 java.lang.String getId()
          Returns writers identification
 int getNrOfSentences()
          Returns number of sentences to be printed at most
 void setBookTitle(java.lang.String title)
          Sets title of book.
 void setId(java.lang.String id)
          Each writer is identified by a unique id.
 void setNrOfSentences(int nrOfSentences)
          Sets number of sentences to be printed at most
abstract  void writeFooter(java.io.Writer out)
          Called after writing all translations.
abstract  void writeHeader(java.io.Writer out)
          Called before writing any translations.
abstract  void writeTranslation(java.io.Writer out, java.lang.String key, java.util.Iterator translations, java.lang.String line, java.lang.String chapter, java.util.Vector sentences)
          Called for each translation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mBook

protected java.lang.String mBook

mSentences

protected int mSentences
Constructor Detail

AbstractTranslationWriter

public AbstractTranslationWriter()
Method Detail

setBookTitle

public void setBookTitle(java.lang.String title)
Description copied from interface: ITranslationWriter
Sets title of book.

Specified by:
setBookTitle in interface ITranslationWriter
Parameters:
title - Title of book

getBookTitle

public java.lang.String getBookTitle()
Description copied from interface: ITranslationWriter
Returns bool title

Specified by:
getBookTitle in interface ITranslationWriter
Returns:
book title

setNrOfSentences

public void setNrOfSentences(int nrOfSentences)
Description copied from interface: ITranslationWriter
Sets number of sentences to be printed at most

Specified by:
setNrOfSentences in interface ITranslationWriter
Parameters:
nrOfSentences - number of sentence to be printed at most

getNrOfSentences

public int getNrOfSentences()
Description copied from interface: ITranslationWriter
Returns number of sentences to be printed at most

Specified by:
getNrOfSentences in interface ITranslationWriter
Returns:
number of sentences

writeHeader

public abstract void writeHeader(java.io.Writer out)
Description copied from interface: ITranslationWriter
Called before writing any translations. Implementations should write any header informations required before translations are written.

Specified by:
writeHeader in interface ITranslationWriter
Parameters:
out - writer output is written to

writeFooter

public abstract void writeFooter(java.io.Writer out)
Description copied from interface: ITranslationWriter
Called after writing all translations. Implementations should write any trailing information.

Specified by:
writeFooter in interface ITranslationWriter
Parameters:
out - writer output is written to.

writeTranslation

public abstract void writeTranslation(java.io.Writer out,
                                      java.lang.String key,
                                      java.util.Iterator translations,
                                      java.lang.String line,
                                      java.lang.String chapter,
                                      java.util.Vector sentences)
Description copied from interface: ITranslationWriter
Called for each translation.

Specified by:
writeTranslation in interface ITranslationWriter
Parameters:
out - output is written to.
key - Word as found in the input.
translations - Iterator of Translation
line - line location where the word occured
chapter - chapter the word occurred
sentences - vector of StringBuffers

formatTranslation

public java.lang.String formatTranslation(java.lang.String aTranslation)

getId

public java.lang.String getId()
Description copied from interface: ITranslationWriter
Returns writers identification

Specified by:
getId in interface ITranslationWriter
Returns:
Returns the id.

setId

public void setId(java.lang.String id)
Description copied from interface: ITranslationWriter
Each writer is identified by a unique id.

Specified by:
setId in interface ITranslationWriter
Parameters:
id - The id to set.


Copyright © 2002-2005 Sourceforge. All Rights Reserved.