anl.aida.reader
Class ProMedPreProcessor

java.lang.Object
  extended by anl.aida.reader.ProMedPreProcessor

public class ProMedPreProcessor
extends java.lang.Object

Preprocesses promed mail alerts, dividing them up if more than one "document" is in the mail text. Each individual document is given the mail title.


Nested Class Summary
private  class ProMedPreProcessor.MultiStreamer
           
private  class ProMedPreProcessor.SingleStreamer
           
private static interface ProMedPreProcessor.Streamer
           
 
Field Summary
private  java.lang.StringBuilder buf
           
private static java.lang.String FOOTER
           
private  java.io.BufferedReader reader
           
private static java.lang.String SECTION_BREAK
           
private  ProMedPreProcessor.Streamer streamer
           
 
Constructor Summary
ProMedPreProcessor(java.io.Reader stream)
          Creates a ProMedPreProcessor that will read from the specified input stream.
 
Method Summary
 void close()
          Closes this preprocessor.
 java.io.Reader next()
          Gets the reader for the next document to read, or null if there is no more documents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECTION_BREAK

private static final java.lang.String SECTION_BREAK
See Also:
Constant Field Values

FOOTER

private static final java.lang.String FOOTER
See Also:
Constant Field Values

streamer

private ProMedPreProcessor.Streamer streamer

buf

private java.lang.StringBuilder buf

reader

private java.io.BufferedReader reader
Constructor Detail

ProMedPreProcessor

public ProMedPreProcessor(java.io.Reader stream)
                   throws java.io.IOException
Creates a ProMedPreProcessor that will read from the specified input stream.

Parameters:
stream - the stream to read from
Throws:
java.io.IOException - if there is an exception reading the stream.
Method Detail

next

public java.io.Reader next()
                    throws java.io.IOException
Gets the reader for the next document to read, or null if there is no more documents.

Returns:
the reader for the next document to read, or null if there is no more documents.
Throws:
java.io.IOException - if there is an error getting the next reader to use.

close

public void close()
           throws java.io.IOException
Closes this preprocessor.

Throws:
java.io.IOException