com.timeindexing.plugin
Class DefaultInputPlugin

java.lang.Object
  extended bycom.timeindexing.plugin.DefaultInputPlugin
All Implemented Interfaces:
InputPlugin

public class DefaultInputPlugin
extends java.lang.Object
implements InputPlugin

A class to input any data


Constructor Summary
DefaultInputPlugin(Index anIndex, java.io.InputStream input)
          Construct an DefaultInputPlugin object given an index and an input stream.
DefaultInputPlugin(Index anIndex, java.io.InputStream input, ReaderPlugin aPlugin)
          Construct an DefaultInputPlugin object given an index and an input stream.
 
Method Summary
 java.lang.Object begin()
          Does nothing.
 java.lang.Object end()
          Does nothing.
 Index getIndex()
          Get the index we are doing input for.
 java.io.InputStream getInputStream()
          Get the InputStream for the InputPlugin.
 ReaderPlugin getReaderPlugin()
          Get the reader plugin.
 boolean isEOF()
          Determine if the reader has hit EOF.
 ReaderResult read()
          Do some input.
 InputPlugin setReaderPlugin(ReaderPlugin reader)
          Set a reader plugin, to read input from the InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInputPlugin

public DefaultInputPlugin(Index anIndex,
                          java.io.InputStream input)
Construct an DefaultInputPlugin object given an index and an input stream. Uses the Line reader plugin, which reads a line at a time.


DefaultInputPlugin

public DefaultInputPlugin(Index anIndex,
                          java.io.InputStream input,
                          ReaderPlugin aPlugin)
Construct an DefaultInputPlugin object given an index and an input stream.

Method Detail

getIndex

public Index getIndex()
Get the index we are doing input for.

Specified by:
getIndex in interface InputPlugin

getInputStream

public java.io.InputStream getInputStream()
Get the InputStream for the InputPlugin.

Specified by:
getInputStream in interface InputPlugin

read

public ReaderResult read()
                  throws java.io.IOException
Do some input.

Specified by:
read in interface InputPlugin
Returns:
the number of byte written
Throws:
java.io.IOException

isEOF

public boolean isEOF()
Determine if the reader has hit EOF.

Specified by:
isEOF in interface InputPlugin

begin

public java.lang.Object begin()
Does nothing.

Specified by:
begin in interface InputPlugin

end

public java.lang.Object end()
Does nothing.

Specified by:
end in interface InputPlugin

setReaderPlugin

public InputPlugin setReaderPlugin(ReaderPlugin reader)
Set a reader plugin, to read input from the InputStream.

Specified by:
setReaderPlugin in interface InputPlugin

getReaderPlugin

public ReaderPlugin getReaderPlugin()
Get the reader plugin.

Specified by:
getReaderPlugin in interface InputPlugin