Class dnx.lr.VRMLPrintStream
All Packages Class Hierarchy This Package Previous Next Index
Class dnx.lr.VRMLPrintStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.FilterOutputStream
|
+----java.io.PrintStream
|
+----dnx.lr.VRMLPrintStream
- public class VRMLPrintStream
- extends PrintStream
This stream is just a relatively shallow subclass of PrintStream
that automatically pretty-prints the output, which is assumed to
be a .wrl file. (Specifically, it maintains a current indent level,
which is changed when []{} characters are seen.) The various print()
methods (called during a PrintAction) are passed a VRMLPrintStream
to send their output to.
-
VRMLPrintStream(OutputStream)
-
-
indent()
-
-
print(char)
- Print out a brace or bracket and adjust the current indentation
level appropriately.
-
print(String)
- Print the string to the underlying PrintStream, making sure
to handle UTF correctly.
-
println(String)
- Print an entire line; i.e.
-
printWithWrap(String)
- Print a string, wrapping if the resulting line would be over 79
characters (unless nothing has been printed on the line so far).
-
setIndentation(String)
-
VRMLPrintStream
public VRMLPrintStream(OutputStream o)
setIndentation
public void setIndentation(String s)
indent
public void indent()
print
public void print(char c)
- Print out a brace or bracket and adjust the current indentation
level appropriately. This always prints out a newline after
the character, and for a closing brace or bracket, will indent()
(at the newly shrunk indent level) before printing the character.
- Overrides:
- print in class PrintStream
printWithWrap
public void printWithWrap(String s)
- Print a string, wrapping if the resulting line would be over 79
characters (unless nothing has been printed on the line so far).
If something has already been printed on the line, print a space
before the string.
print
public synchronized void print(String s)
- Print the string to the underlying PrintStream, making sure
to handle UTF correctly.
- Overrides:
- print in class PrintStream
println
public void println(String s)
- Print an entire line; i.e. indent, then print(), then print a
newline. Only call this is you're printing the entire line; if
you're printing the last bit of a line, call print() and give
the newline yourself (otherwise, you'll get an indent in the
middle of a line).
- Overrides:
- println in class PrintStream
All Packages Class Hierarchy This Package Previous Next Index