net.sourceforge.cruisecontrol.util
Class BuildOutputBuffer

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.util.BuildOutputBuffer
All Implemented Interfaces:
StreamConsumer

public class BuildOutputBuffer
extends java.lang.Object
implements StreamConsumer

Tracks a "buffer" of lines from a build, which allows a caller to ask all lines after a certain starting line number. Note that the buffer rotates and will only include up to the last maxLines lines written to the buffer.


Constructor Summary
BuildOutputBuffer(int maxLines)
           
 
Method Summary
 void consumeLine(java.lang.String line)
          Consumes the line provided by adding it next in the buffer.
 java.lang.String[] retrieveLines(int firstLine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildOutputBuffer

public BuildOutputBuffer(int maxLines)
Parameters:
maxLines - Maximum number of lines that can be placed into the buffer.
Method Detail

consumeLine

public void consumeLine(java.lang.String line)
Consumes the line provided by adding it next in the buffer. If the buffer is full, it starts back at the beginning of the buffer!!!

Specified by:
consumeLine in interface StreamConsumer

retrieveLines

public java.lang.String[] retrieveLines(int firstLine)
Returns:
All lines available from firstLine (inclusive) up to maxLines.