anl.aida.reader
Interface LineParser

All Known Implementing Classes:
ProMedTxtReader.ContentParser, ProMedTxtReader.LinkParser, ProMedTxtReader.NullParser, ProMedTxtReader.TitleParser

public interface LineParser

Interface for classes that can parse a line of text. The intention is that LineParsers can be chained together to produce a full parser. For example, one might look for a Date and then when that is found next() would return the parser that parses the documents content.


Method Summary
 LineParser next()
          Returns the next LineParser in the chain.
 boolean parse(java.lang.String line, java.lang.StringBuilder buf)
          Parses the specified line of text.
 

Method Detail

parse

boolean parse(java.lang.String line,
              java.lang.StringBuilder buf)
Parses the specified line of text. The StringBuilder should accumulate the documents true content in contrast to any metadata that might be parsed such as the date and so forth.

Parameters:
line - the line of text to parse
buf - the buffer to put the actual content in
Returns:
true if next() should be called, otherwise false.

next

LineParser next()
Returns the next LineParser in the chain.

Returns:
the next LineParser in the chain.