net.sourceforge.taverna.scuflworkers.ncbi
Class ReplacementStreamProcessor

java.lang.Object
  extended by net.sourceforge.taverna.scuflworkers.ncbi.ReplacementStreamProcessor
All Implemented Interfaces:
StreamProcessor
Direct Known Subclasses:
NCBIXMLStreamProcessor

public class ReplacementStreamProcessor
extends java.lang.Object
implements StreamProcessor

This class replaces text in the stream Last edited by $Author: sowen70 $

Version:
$Revision: 1.2 $
Author:
Mark

Constructor Summary
ReplacementStreamProcessor()
           
ReplacementStreamProcessor(java.lang.String[] oldText, java.lang.String[] replacementText)
          Constructor
ReplacementStreamProcessor(java.lang.String _oldText, java.lang.String _replacementText)
          Constructor
 
Method Summary
 java.lang.String[] getOldText()
           
 java.lang.String[] getReplacementText()
           
 java.util.Map processStream(java.io.InputStream stream)
          This method iterates through a series of oldText and replacementText pairs, replacing all occurrences of the oldText with the replacementText.
 void setOldText(java.lang.String[] oldText)
           
 void setReplacementText(java.lang.String[] replacementText)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplacementStreamProcessor

public ReplacementStreamProcessor()

ReplacementStreamProcessor

public ReplacementStreamProcessor(java.lang.String _oldText,
                                  java.lang.String _replacementText)
Constructor

Parameters:
filename -
_oldText -
_replacementText -

ReplacementStreamProcessor

public ReplacementStreamProcessor(java.lang.String[] oldText,
                                  java.lang.String[] replacementText)
Constructor

Parameters:
filename -
oldText -
replacementText -
Method Detail

processStream

public java.util.Map processStream(java.io.InputStream stream)
                            throws java.io.IOException
This method iterates through a series of oldText and replacementText pairs, replacing all occurrences of the oldText with the replacementText. The results are then written out to the file supplied in the constructor.

Specified by:
processStream in interface StreamProcessor
Parameters:
stream -
Throws:
java.io.IOException

getOldText

public java.lang.String[] getOldText()
Returns:
Returns the oldText.

setOldText

public void setOldText(java.lang.String[] oldText)
Parameters:
oldText - The oldText to set.

getReplacementText

public java.lang.String[] getReplacementText()
Returns:
Returns the replacementText.

setReplacementText

public void setReplacementText(java.lang.String[] replacementText)
Parameters:
replacementText - The replacementText to set.