com.townleyenterprises.io
Class AbstractLineProcessor

java.lang.Object
  extended bycom.townleyenterprises.io.AbstractLineProcessor
All Implemented Interfaces:
LineProcessor
Direct Known Subclasses:
DelimitedLineProcessor

public abstract class AbstractLineProcessor
extends java.lang.Object
implements LineProcessor

This class is used to provide default implementations for the methods in the LineProcessor interface. It also keeps track of the count of lines processed.

Since:
2.1
Version:
$Id: AbstractLineProcessor.java,v 1.1 2004/01/26 18:49:36 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
AbstractLineProcessor()
           
 
Method Summary
 int getLineCount()
          This method returns the number of lines processed since the last reset.
 void processLine(java.lang.String line)
          This method gets called for each line processed containing the text of the line.
 void reset()
          This method gets called to reset any internal state maintained by the instance prior to starting any input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLineProcessor

public AbstractLineProcessor()
Method Detail

processLine

public void processLine(java.lang.String line)
                 throws java.lang.Exception
This method gets called for each line processed containing the text of the line.

Specified by:
processLine in interface LineProcessor
Parameters:
line - the line of the input file
Throws:
java.lang.Exception - if an error occurs processing the line

reset

public void reset()
This method gets called to reset any internal state maintained by the instance prior to starting any input.

Specified by:
reset in interface LineProcessor

getLineCount

public int getLineCount()
This method returns the number of lines processed since the last reset.

Returns:
the count


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.