Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.io
Class IndentingWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by com.tangosol.io.IndentingWriter

All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class IndentingWriter
extends java.io.PrintWriter

An IndentingWriter is used to indent line-based output to an underlying Writer.

Author:
cp 2000.10.17

Field Summary

 

Fields inherited from class java.io.PrintWriter
out

 

Fields inherited from class java.io.Writer
lock

 

Constructor Summary
IndentingWriter(java.io.Writer writer, int cSpaces)
          Construct an IndentingWriter that indents a certain number of spaces.
IndentingWriter(java.io.Writer writer, java.lang.String sIndent)
          Construct an IndentingWriter that indents using an indention string.

 

Method Summary
 void println()
          Terminate the current line by writing the line separator string.
 void resume()
          Resumes indentation.
 void suspend()
          Suspends indentation.
 void write(char[] cbuf, int off, int len)
          Write a portion of an array of characters.
 void write(int c)
          Write a single character.
 void write(java.lang.String str)
          Write a string.
 void write(java.lang.String str, int off, int len)
          Write a portion of a string.

 

Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write

 

Constructor Detail

IndentingWriter

public IndentingWriter(java.io.Writer writer,
                       int cSpaces)
Construct an IndentingWriter that indents a certain number of spaces.
Parameters:
writer - the underlying writer to write to
cSpaces - the number of spaces to indent each line with

IndentingWriter

public IndentingWriter(java.io.Writer writer,
                       java.lang.String sIndent)
Construct an IndentingWriter that indents using an indention string.
Parameters:
writer - the underlying writer to write to
sIndent - the String value to indent each line with

Method Detail

write

public void write(int c)
Write a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.

Subclasses that intend to support efficient single-character output should override this method.

Overrides:
write in class java.io.PrintWriter
Parameters:
c - int specifying a character to be written.

write

public void write(char[] cbuf,
                  int off,
                  int len)
Write a portion of an array of characters.
Overrides:
write in class java.io.PrintWriter
Parameters:
cbuf - Array of characters
off - Offset from which to start writing characters
len - Number of characters to write

write

public void write(java.lang.String str)
Write a string.
Overrides:
write in class java.io.PrintWriter
Parameters:
str - String to be written

write

public void write(java.lang.String str,
                  int off,
                  int len)
Write a portion of a string.
Overrides:
write in class java.io.PrintWriter
Parameters:
str - A String
off - Offset from which to start writing characters
len - Number of characters to write

println

public void println()
Terminate the current line by writing the line separator string. The line separator string is defined by the system property line.separator, and is not necessarily a single newline character ('\n').
Overrides:
println in class java.io.PrintWriter

suspend

public void suspend()
Suspends indentation.

resume

public void resume()
Resumes indentation.

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.