org.acm.seguin.pretty
Class LineQueue

java.lang.Object
  extended by org.acm.seguin.pretty.LineQueue

public class LineQueue
extends java.lang.Object

Stores a queue of lines to be printed

Author:
Chris Seguin

Field Summary
protected  int lineNumber
          The current line number
 
Constructor Summary
LineQueue(java.io.PrintWriter init)
          Constructor for the LineQueue object
 
Method Summary
 void appendCategoryComment(java.lang.String comment, java.lang.String prefix)
          Appends a comment to the file
 void appendSingleLineComment(java.lang.String comment, java.lang.String prefix)
          Appends a comment to the file
 void flush()
          Flushes all the lines in the buffer
 void flushFirstLine()
          Flushes the first line in the cache
 int getCurrentLine()
          Returns the current line
protected  java.io.PrintWriter getOutput()
          Gets the Output attribute of the LineQueue object
 void println(java.lang.String value)
          Description of the Method
 void setAbsoluteCommentSpacing(int value)
          Sets the AbsoluteCommentSpacing attribute of the LineQueue object
 void setIncrementalCommentSpacing(int value)
          Sets the IncrementalCommentSpacing attribute of the LineQueue object
 void setOwnline(boolean value)
          Sets the Ownline attribute of the LineQueue object
 void setOwnlineCode(boolean value)
          Sets the OwnlineCode attribute of the LineQueue object
 void setSharedIncremental(boolean value)
          Sets the SharedIncremental attribute of the LineQueue object
protected  void writeln(java.lang.String value)
          Writes a single line to the output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineNumber

protected int lineNumber
The current line number

Constructor Detail

LineQueue

public LineQueue(java.io.PrintWriter init)
Constructor for the LineQueue object

Parameters:
init - Description of Parameter
Method Detail

setAbsoluteCommentSpacing

public void setAbsoluteCommentSpacing(int value)
Sets the AbsoluteCommentSpacing attribute of the LineQueue object

Parameters:
value - The new AbsoluteCommentSpacing value

setIncrementalCommentSpacing

public void setIncrementalCommentSpacing(int value)
Sets the IncrementalCommentSpacing attribute of the LineQueue object

Parameters:
value - The new IncrementalCommentSpacing value

setOwnline

public void setOwnline(boolean value)
Sets the Ownline attribute of the LineQueue object

Parameters:
value - The new Ownline value

setSharedIncremental

public void setSharedIncremental(boolean value)
Sets the SharedIncremental attribute of the LineQueue object

Parameters:
value - The new SharedIncremental value

setOwnlineCode

public void setOwnlineCode(boolean value)
Sets the OwnlineCode attribute of the LineQueue object

Parameters:
value - The new OwnlineCode value

getCurrentLine

public int getCurrentLine()
Returns the current line

Returns:
the line number

println

public void println(java.lang.String value)
Description of the Method

Parameters:
value - Description of Parameter

appendSingleLineComment

public void appendSingleLineComment(java.lang.String comment,
                                    java.lang.String prefix)
Appends a comment to the file

Parameters:
comment - the comment to append
prefix - the prefix to the line

appendCategoryComment

public void appendCategoryComment(java.lang.String comment,
                                  java.lang.String prefix)
Appends a comment to the file

Parameters:
comment - the comment to append
prefix - the prefix to the line

flushFirstLine

public void flushFirstLine()
Flushes the first line in the cache


flush

public void flush()
Flushes all the lines in the buffer


getOutput

protected java.io.PrintWriter getOutput()
Gets the Output attribute of the LineQueue object

Returns:
The Output value

writeln

protected void writeln(java.lang.String value)
Writes a single line to the output stream

Parameters:
value - Description of Parameter