JML

org.jmlspecs.jmlunit
Class FancyTabbedPrintWriter

java.lang.Object
  extended byorg.jmlspecs.jmlunit.FancyTabbedPrintWriter

public class FancyTabbedPrintWriter
extends Object

A more convenient print writer.

Version:
$Revision: 1.1 $
Author:
Gary T. Leavens

Field Summary
private  int pos
          The column number where the next text should be written by the writer.
private  int tabSize
          The depth of indentation.
private  TabbedPrintWriter writer
          The writer to which the output is to be printed.
 
Constructor Summary
FancyTabbedPrintWriter(Writer writer)
          Initialize this fancy tabbed print writer.
FancyTabbedPrintWriter(Writer writer, int tabSize)
          Initialize this fancy tabbed print writer.
 
Method Summary
 void close()
          Close this file.
 void indent()
          Indents one TAB_SIZE.
 void newLine()
          Prints a line separator.
 void print(Object s)
          Prints the given object.
 void print(String s)
          Prints the given string.
 void println(Object s)
          Prints the given object with a trailing line separator.
 void printlnIn(Object s)
          Prints the given object with one tabSize indentation and a trailing line separator.
 void setTabSize(int n)
          Set the tab size to the given integer.
 void undent()
          Und-ndents one tabSize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

private TabbedPrintWriter writer
The writer to which the output is to be printed.


tabSize

private int tabSize
The depth of indentation.

 private invariant_redundantly tabSize > 0;
 


pos

private int pos
The column number where the next text should be written by the writer.

 private invariant pos >= 0;
 

Constructor Detail

FancyTabbedPrintWriter

public FancyTabbedPrintWriter(Writer writer)
Initialize this fancy tabbed print writer. The default tab size, 4, is appropriate for emacs. (:-)


FancyTabbedPrintWriter

public FancyTabbedPrintWriter(Writer writer,
                              int tabSize)
Initialize this fancy tabbed print writer.

Method Detail

indent

public void indent()
Indents one TAB_SIZE.


undent

public void undent()
Und-ndents one tabSize.


print

public void print(Object s)
Prints the given object.


print

public void print(String s)
Prints the given string.


println

public void println(Object s)
Prints the given object with a trailing line separator.


printlnIn

public void printlnIn(Object s)
Prints the given object with one tabSize indentation and a trailing line separator.


newLine

public void newLine()
Prints a line separator.


setTabSize

public void setTabSize(int n)
Set the tab size to the given integer.


close

public void close()
Close this file.


JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.