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


public interface LineWrapper

Defines a method to retrieve the next line wrapping position.

Unfortunately the line wrapping "rules" applied manually are sometimes following the sole rule:

if (looks nice) then wrap();

which makes it impossible to create an identical flat file in an automated way.
Therefore the wrapping classes implementing this interface should try to cover all manual line wrapping rules which do not follow this rule.

The line wrapping rules are defined in the following PDF file:

   •  enzyme_LW_rules.pdf (preliminary version, i.e. not approved by Amos)

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

Method Summary
 int findPosition(String text, int netLineWidth)
          Returns the next position in the line where the wrapping should be performed.
 

Method Detail

findPosition

int findPosition(String text,
                 int netLineWidth)
                 throws EnzymeFlatFileWriteException
Returns the next position in the line where the wrapping should be performed.

This method is supposed to be used by a LineFormatter implementation within a loop as long as the text does not fit into one line.

Parameters:
text - The text to be wrapped.
netLineWidth - Net line width (w/o line header in the begining).
Returns:
athe line break position.
Throws:
EnzymeFlatFileWriteException - if an error occured during this process.


Copyright © 2013 EMBL-EBI. All Rights Reserved.