Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework.interfaces
Interface ILineReader


public interface ILineReader

The ILineReader interface defines the API for line-oriented reading of an InputStream. An instance of ILineReader can be created using the FactoryUtility singleton.

 FactoryUtility utility = FactoryUtility.getInstance();
 InputStream stream = ...
 try {
   ILineReader reader = utility.createLineReader(stream);
   try {
     ...
   } finally {
     reader.close();
   }
 } catch (IOException exception) {
   ...
 }
 
While a single line may be read using the readLine() method, reading multiple lines is typically done by calling the lines() method that returns an Enumeration.
 Enumeration lines = reader.lines();
 while (lines.hasMoreElements() == true) {
   String line = (String) lines.nextElement();
   ...
 }
 
The nested IAdvisor interface defines the advice that can be given an ILineReader as each line is read.

See Also:
ILineReader.IAdvisor, FactoryUtility

Nested Class Summary
static interface ILineReader.IAdvisor
          The IAdvisor interface defines the advice that can be given to an ILineReader as each line is read.
 
Method Summary
 void close()
          Close the receiver.
 Enumeration lines()
          Answers an Enumeration for reading lines.
 String readLine()
          Reads and answers a single line.
 

Method Detail

close

void close()
           throws IOException
Close the receiver.

Throws:
IOException

lines

Enumeration lines()
Answers an Enumeration for reading lines.

Returns:
An Enumeration used for reading the lines from the InputStream.

readLine

String readLine()
                throws IOException
Reads and answers a single line.

Returns:
A String containing single line from the source InputStream.
Throws:
IOException

Service Activator Toolkit
Version 1.1.0 (20081206)