net.sourceforge.groboutils.codecoverage.v2.util
Class ConvertSingleLog

java.lang.Object
  extended bynet.sourceforge.groboutils.codecoverage.v2.util.ConvertSingleLog

public class ConvertSingleLog
extends java.lang.Object

A way to convert the single log style (not necessarily a file), and outputs it to a channel logger. This converter handles multiple channels.

As of 2004-Jun-03, the format has changed.

Since:
April 16, 2004
Version:
$Date: 2004/07/07 09:39:11 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
ConvertSingleLog(IChannelLogger[] ch)
          Create a new converter, using the given initialized loggers as the output channels.
 
Method Summary
protected  java.lang.String lastElement(int[] pos, java.lang.String line)
           
protected  java.lang.String nextElement(int[] pos, java.lang.String line)
           
protected  short nextShort(int[] pos, java.lang.String line)
           
protected  short parseShort(java.lang.String txt, java.lang.String line)
           
 void processLine(java.lang.String line, boolean ignoreFormatErrors)
          Process a single line from the single file.
 void read(java.io.Reader r, boolean ignoreFormatErrors)
          Loads all data from the given reader and parses it out to the channels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvertSingleLog

public ConvertSingleLog(IChannelLogger[] ch)
Create a new converter, using the given initialized loggers as the output channels. The order matters: each logger index refers to that specific channel index; so ch[1] refers to channel 1.

Parameters:
ch - the channels to output the single log to.
Throws:
java.lang.IllegalArgumentException - if ch or any entry inside ch is null, or if the length of ch is 0.
Method Detail

read

public void read(java.io.Reader r,
                 boolean ignoreFormatErrors)
          throws java.io.IOException
Loads all data from the given reader and parses it out to the channels. The reader is closed on return.

Throws:
java.io.IOException - if there is an I/O error reading from r.
java.lang.IllegalArgumentException - if the reader is null.

processLine

public void processLine(java.lang.String line,
                        boolean ignoreFormatErrors)
                 throws java.io.IOException
Process a single line from the single file. Invalid formatted lines will cause an I/O exception. Blank lines are ignored. Whitespace is also ignored.

Parameters:
line - the input line
Throws:
java.io.IOException - if there's a problem with the format of the line, or if line is null.

nextElement

protected java.lang.String nextElement(int[] pos,
                                       java.lang.String line)
                                throws java.io.IOException
Throws:
java.io.IOException

nextShort

protected short nextShort(int[] pos,
                          java.lang.String line)
                   throws java.io.IOException
Throws:
java.io.IOException

lastElement

protected java.lang.String lastElement(int[] pos,
                                       java.lang.String line)
                                throws java.io.IOException
Throws:
java.io.IOException

parseShort

protected short parseShort(java.lang.String txt,
                           java.lang.String line)
                    throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2001-2003 by The GroboUtils Project