public interface LineFormatter
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.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:
Modifier and Type | Field and Description |
---|---|
static int |
LINEWIDTH
Defines the maximum line width within the flat file.
|
Modifier and Type | Method and Description |
---|---|
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. |
static final int LINEWIDTH
String formatLines(String text, LineType lineType) throws EnzymeFlatFileWriteException
line type
as
described in the class description.text
- The whole text of one line type.lineType
- The line type
.EnzymeFlatFileWriteException
- if an error occured during the formatting process.Copyright © 2014 EMBL-EBI. All rights reserved.