at.dms.compiler
Class TabbedPrintWriter

java.lang.Object
  extended by at.dms.compiler.TabbedPrintWriter
All Implemented Interfaces:
DeepCloneable

public class TabbedPrintWriter
extends Object
implements DeepCloneable

This class implements a tabbed print writer


Field Summary
protected  int column
           
protected  int line
           
protected  int pos
           
 
Constructor Summary
TabbedPrintWriter(Writer writer)
          construct a pretty printer object for java code
 
Method Summary
 void add(int pos)
          Increment tab
 void close()
          Close the stream at the end
 Object deepClone()
          Returns a deep clone of this object.
protected  void deepCloneInto(TabbedPrintWriter other)
          Clones all fields of this into
 int getColumn()
           
 int getLine()
           
 int getPos()
           
 void print(String s)
          Print a string
 void println()
          Print a new line
 void setPos(int pos)
          Set pos
 void sub(int pos)
          Decrement tab
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pos

protected int pos

line

protected int line

column

protected int column
Constructor Detail

TabbedPrintWriter

public TabbedPrintWriter(Writer writer)
construct a pretty printer object for java code

Parameters:
writer - underlying Writer into which the code is generated
Method Detail

close

public void close()
Close the stream at the end


getLine

public int getLine()

getColumn

public int getColumn()

getPos

public int getPos()

setPos

public void setPos(int pos)
Set pos


add

public void add(int pos)
Increment tab


sub

public void sub(int pos)
Decrement tab


println

public void println()
Print a new line


print

public void print(String s)
Print a string


deepClone

public Object deepClone()
Returns a deep clone of this object.

Specified by:
deepClone in interface DeepCloneable

deepCloneInto

protected void deepCloneInto(TabbedPrintWriter other)
Clones all fields of this into
other