uvi
Class Q

java.lang.Object
  extended by uvi.Q

public class Q
extends Object

With a name chosen almost entirely on the basis of brevity, this class was only created for the purpose of removing the complexity of writing text to an output stream to a separate file. Another class in the package first sets this class's writer to an already-instantiated writer, and then calls any of the many "oh" methods, which stand for "Output HTML" - pretty simple. The reason there are so many "oh" methods is that the HTML generated by this UVI tool is formatted. It is not clumped together as if it were clearly created by an automatic process. It is indented just as the author of this tool would indent his HTML code. Therefore, each method below provides a slightly different interface for controlling the indentation and newlines sent to the output stream.

NOTE: Any reference to "HTML Files" should be taken as a synonym for "PHP Files." When this documentation was created, only *.html files were used. Later, they were converted to *.php files to facilitate dynamic content (i.e. comments).

Version:
1.0, 2006.9.8
Author:
Derek Trumbo
See Also:
Generator.generateHTMLFiles(), Generator.generateIndexFiles(), Sweeper

Field Summary
private static PrintWriter curWriter
          The output stream for the current HTML file being processed.
 
Constructor Summary
private Q()
          This constructor is private because the class is not intended to ever be instantiated.
 
Method Summary
(package private) static PrintWriter getWriter()
          Returns the class's output stream (PrintWriter).
(package private) static void oh(boolean newLine, String html)
          Places the given HTML code into the output stream and optionally ending with a newline.
(package private) static void oh(int indentLevel, boolean newLine, String html)
          Places the given HTML code into the output stream at the given indentation level and optionally prints a newline.
(package private) static void oh(int indentLevel, String html)
          Places the given HTML code into the output stream at the given indentation level.
(package private) static void oh(String html)
          Places the given HTML code into the output stream without indenting or printing a newline.
(package private) static void setWriter(PrintWriter newWriter)
          Sets the class's output stream (PrintWriter).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

curWriter

private static PrintWriter curWriter
The output stream for the current HTML file being processed. It is set right as each HTML file is about to be generated and is used in the Q.oh "Output HTML" methods.

See Also:
Generator.generateHTMLFiles(), Generator.generateIndexFiles()
Constructor Detail

Q

private Q()
This constructor is private because the class is not intended to ever be instantiated. The UVI generation is a very procedural process and thus all the members are static.

Method Detail

setWriter

static void setWriter(PrintWriter newWriter)
Sets the class's output stream (PrintWriter).

Parameters:
newWriter - the output stream to set as the one to use when printing
See Also:
Generator.generateHTMLFiles(), Generator.generateIndexFiles()

getWriter

static PrintWriter getWriter()
Returns the class's output stream (PrintWriter).

Returns:
the currently set output stream
See Also:
Generator.generateHTMLFiles(), Generator.generateIndexFiles()

oh

static void oh(String html)
Places the given HTML code into the output stream without indenting or printing a newline.

Parameters:
html - the HTML code to place into the output stream

oh

static void oh(boolean newLine,
               String html)
Places the given HTML code into the output stream and optionally ending with a newline. Does not indent.

Parameters:
newLine - whether or not to print a newline after the HTML code
html - the HTML code to place into the output stream

oh

static void oh(int indentLevel,
               String html)
Places the given HTML code into the output stream at the given indentation level. This method DOES print a newline. Each level of indentation prints three spaces to the output stream.

Parameters:
indentLevel - the indentation level at which to start the HTML code
html - the HTML code to place into the output stream

oh

static void oh(int indentLevel,
               boolean newLine,
               String html)
Places the given HTML code into the output stream at the given indentation level and optionally prints a newline. Each level of indentation prints three spaces to the output stream.

Parameters:
indentLevel - the indentation level at which to start the HTML code
newLine - whether or not to print a newline after the HTML code
html - the HTML code to place into the output stream