uk.ac.ebi.intenz.tools.sib.writer
Interface LineFormatter

All Known Implementing Classes:
CC_LineFormatter, DefaultLineFormatter

public interface LineFormatter

This interface provides a method to format lines according to the rules of the enzyme.dat file.

Some of the rules can be found here.

The formatting of lines is dependent on the line type and the content of each line type. A LineFormatter implementation will provide a means to format and wrap the lines of a line type by implementing formatLines(String, LineType).

As rules for wrapping lines are often applicable to several line types, the wrapping is defined by the interface LineWrapper, which defines the implementation of line wrapping rules. These rules should be used within a LineFormatter concrete class.

Apart from the correct line wrapping the LineFormatter must take care of proper formatting in the beginning of the line, i.e. line headers.
For example, in case of the CC line type the LineFormatter must format each line beginning with >CC < plus an additional >-!- < to indicate the beginning of a sentence or spaces, if the line is a continuation of a sentence.

Example:

Version:
$Revision: 1.2 $ $Date: 2008/01/28 11:43:23 $
Author:
Michael Darsow

Field Summary
static int LINEWIDTH
          Defines the maximum line width within the flat file.
 
Method Summary
 String formatLines(String text, LineType lineType)
          This method takes care of proper formatting of the line(s) corresponding one line type as described in the class description.
 

Field Detail

LINEWIDTH

static final int LINEWIDTH
Defines the maximum line width within the flat file.

See Also:
Constant Field Values
Method Detail

formatLines

String formatLines(String text,
                   LineType lineType)
                   throws EnzymeFlatFileWriteException
This method takes care of proper formatting of the line(s) corresponding one line type as described in the class description.

Parameters:
text - The whole text of one line type.
lineType - The line type.
Returns:
the formatted lines.
Throws:
EnzymeFlatFileWriteException - if an error occured during the formatting process.


Copyright © 2013 EMBL-EBI. All Rights Reserved.