<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
 * @(#)HtmlWriter.java	1.24 98/09/22
 *
 * Copyright 1997, 1998 by Sun Microsystems, Inc.,
 * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Sun Microsystems, Inc. ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Sun.
 */

package com.sun.tools.doclets;

import com.sun.javadoc.*;
import java.io.*;
import java.lang.*;
import java.util.*;

/**
 * Class for the Html format code generation. 
 * Initilizes PrintWriter with FileWriter, to enable print
 * related methods to generate the code to the named File through FileWriter.
 *
 * @since JDK1.2
 * @author Atul M Dambalkar 
 */
public class HtmlWriter extends PrintWriter {

    /**
     * Name of the file, to which this writer is writing to.
     */
    protected final String htmlFilename;

    /**
     * URL file separator string("/").
     */
    public static final String fileseparator = 
                                          DirectoryManager.urlfileseparator;

    /**
     * Initializes PrintWriter with the FileWriter.
     *
     * @param filename File Name to which the PrintWriter will do the Output.
     * @param docencoding Encoding to be used for this file.
     * @exception IOException Exception raised by the FileWriter is passed on
     * to next level.
     * @exception UnSupportedEncodingException Exception raised by the 
     * OutputStreamWriter is passed on to next level.
     */
    public HtmlWriter(String filename, String docencoding) 
                      throws IOException, UnsupportedEncodingException {
        super(genWriter(null, filename, docencoding));
        htmlFilename = filename;
    }

    /**
     * Initializes PrintWriter with the FileWriter.
     *
     * @param path The directory path to be created for this file.
     * @param filename File Name to which the PrintWriter will do the Output.
     * @param docencoding Encoding to be used for this file.
     * @exception IOException Exception raised by the FileWriter is passed on
     * to next level.
     * @exception UnSupportedEncodingException Exception raised by the 
     * OutputStreamWriter is passed on to next level.
     */
    public HtmlWriter(String path, String filename, String docencoding) 
                      throws IOException, UnsupportedEncodingException {
        super(genWriter(path, filename, docencoding));
        htmlFilename = filename;
    }

    /**
     * Create the directory path for the file to be generated, construct 
     * FileOutputStream and OutputStreamWriter depending upon docencoding.
     *
     * @param path The directory path to be created for this file.
     * @param filename File Name to which the PrintWriter will do the Output.
     * @param docencoding Encoding to be used for this file.
     * @exception IOException Exception raised by the FileWriter is passed on
     * to next level.
     * @exception UnSupportedEncodingException Exception raised by the 
     * OutputStreamWriter is passed on to next level.
     * @return Writer Writer for the file getting generated.
     * @see java.io.FileOutputStream
     * @see java.io.OutputStreamWriter
     */
    static Writer genWriter(String path, String filename, String docencoding) 
                            throws IOException, UnsupportedEncodingException {
        FileOutputStream fos;
        if (path != null) {
            DirectoryManager.createDirectory(path);
            fos = new FileOutputStream(((path.length() &gt; 0)? 
                                         path + fileseparator: "") + filename);
        } else {
            fos = new FileOutputStream(filename);
        }
        if (docencoding == null) {
            OutputStreamWriter oswriter = new OutputStreamWriter(fos);
            docencoding = oswriter.getEncoding();
            return oswriter;
        } else {
            return new OutputStreamWriter(fos, docencoding);
        }
    }

    /**
     * Print &amp;lt;HTML&amp;gt; tag. Add a newline character at the end.
     */
    public void html() {
        println("&lt;HTML&gt;");
    }

    /**
     * Print &amp;lt;/HTML&amp;gt; tag. Add a newline character at the end.
     */
    public void htmlEnd() {
        println("&lt;/HTML&gt;");
    }

    /**
     * Print &amp;lt;BODY&amp;gt; tag. Add a newline character at the end.
     */
    public void body() {
        println("&lt;BODY&gt;");
    }

    /**
     * Print &amp;lt;BODY BGCOLOR="bgcolor"&amp;gt; tag. Add a newline character at the end.
     *
     * @param bgcolor BackGroung color.
     */    
    public void body(String bgcolor) {
        println("&lt;BODY BGCOLOR=\"" + bgcolor + "\"&gt;");
    }

    /**
     * Print &amp;lt;/BODY&amp;gt; tag. Add a newline character at the end.
     */
    public void bodyEnd() {
        println("&lt;/BODY&gt;");
    }

    /**
     * Print &amp;lt;TITLE&amp;gt; tag. Add a newline character at the end.
     */
    public void title() {
        println("&lt;TITLE&gt;");
    }

    /**
     * Print &amp;lt;/TITLE&amp;gt; tag. Add a newline character at the end.
     */    
    public void titleEnd() {
        println("&lt;/TITLE&gt;");
    }

    /**
     * Print &amp;lt;UL&amp;gt; tag. Add a newline character at the end.
     */
    public void ul() {
        println("&lt;UL&gt;");
    }

    /**
     * Print &amp;lt;/UL&amp;gt; tag. Add a newline character at the end.
     */
    public void ulEnd() {
        println("&lt;/UL&gt;");
    }

    /**
     * Print &amp;lt;LI&amp;gt; tag.
     */
    public void li() {
        print("&lt;LI&gt;");
    }

    /**
     * Print &amp;lt;LI TYPE="type"&amp;gt; tag.
     *
     * @param type Type string.
     */
    public void li(String type) {
        print("&lt;LI TYPE=\"" + type + "\"&gt;");
    }

    /**
     * Print &amp;lt;H1&amp;gt; tag. Add a newline character at the end.
     */
    public void h1() {
        println("&lt;H1&gt;");
    }

    /**
     * Print &amp;lt;/H1&amp;gt; tag. Add a newline character at the end.
     */
    public void h1End() {
        println("&lt;/H1&gt;");
    }

    /**
     * Print text with &amp;lt;H1&amp;gt; tag. Also adds &amp;lt;/H1&amp;gt; tag. Add a newline character
     * at the end of the text. 
     *
     * @param text Text to be printed with &amp;lt;H1&amp;gt; format.
     */
    public void h1(String text) {
        h1();
        println(text);
        h1End();
    }

    /**
     * Print &amp;lt;H2&amp;gt; tag. Add a newline character at the end.
     */
    public void h2() {
        println("&lt;H2&gt;");
    }

    /**
     * Print text with &amp;lt;H2&amp;gt; tag. Also adds &amp;lt;/H2&amp;gt; tag. Add a newline character
     *  at the end of the text. 
     *
     * @param text Text to be printed with &amp;lt;H2&amp;gt; format.
     */
    public void h2(String text) {
        h2();
        println(text);
        h2End();
    }

    /**
     * Print &amp;lt;/H2&amp;gt; tag. Add a newline character at the end.
     */
    public void h2End() {
        println("&lt;/H2&gt;");
    }

    /**
     * Print &amp;lt;H3&amp;gt; tag. Add a newline character at the end.
     */
    public void h3() {
        println("&lt;H3&gt;");
    }

    /**
     * Print text with &amp;lt;H3&amp;gt; tag. Also adds &amp;lt;/H3&amp;gt; tag. Add a newline character
     *  at the end of the text.  
     *
     * @param text Text to be printed with &amp;lt;H3&amp;gt; format.
     */
    public void h3(String text) {
        h3();
        println(text);
        h3End();
    }

    /**
     * Print &amp;lt;/H3&amp;gt; tag. Add a newline character at the end.
     */
    public void h3End() {
        println("&lt;/H3&gt;");
    }

    /**
     * Print &amp;lt;H4&amp;gt; tag. Add a newline character at the end.
     */
    public void h4() {
        println("&lt;H4&gt;");
    }

    /**
     * Print &amp;lt;/H4&amp;gt; tag. Add a newline character at the end.
     */
    public void h4End() {
        println("&lt;/H4&gt;");
    }

    /**
     * Print text with &amp;lt;H4&amp;gt; tag. Also adds &amp;lt;/H4&amp;gt; tag. Add a newline character
     * at the end of the text.  
     *
     * @param text Text to be printed with &amp;lt;H4&amp;gt; format.
     */
    public void h4(String text) {
        h4();
        println(text);
        h4End();
    }

    /**
     * Print &amp;lt;H5&amp;gt; tag. Add a newline character at the end.
     */
    public void h5() {
        println("&lt;H5&gt;");
    }

    /**
     * Print &amp;lt;/H5&amp;gt; tag. Add a newline character at the end.
     */
    public void h5End() {
        println("&lt;/H5&gt;");
    }

    /**
     * Print HTML &amp;lt;IMG SRC="imggif" WIDTH="width" HEIGHT="height" ALT="imgname&amp;gt;
     * tag. It prepends the "images" directory name to the "imggif". This 
     * method is used for oneone format generation. Add a newline character 
     * at the end.
     * 
     * @param imggif   Image GIF file.
     * @param imgname  Image name.
     * @param width    Width of the image.
     * @param height   Height of the image.
     */
    public void img(String imggif, String imgname, int width, int height) {
        println("&lt;IMG SRC=\"images/" + imggif + ".gif\"" 
              + " WIDTH=\"" + width + "\" HEIGHT=\"" + height 
              + "\" ALT=\"" + imgname + "\"&gt;");
    }

    /**
     * Print &amp;lt;MENU&amp;gt; tag. Add a newline character at the end.
     */
    public void menu() {
        println("&lt;MENU&gt;");
    }

    /**
     * Print &amp;lt;/MENU&amp;gt; tag. Add a newline character at the end.
     */
    public void menuEnd() {
        println("&lt;/MENU&gt;");
    }

    /**
     * Print &amp;lt;PRE&amp;gt; tag. Add a newline character at the end.
     */
    public void pre() {
        println("&lt;PRE&gt;");
    }

    /**
     * Print &amp;lt;/PRE&amp;gt; tag. Add a newline character at the end.
     */
    public void preEnd() {
        println("&lt;/PRE&gt;");
    }
    
    /**
     * Print &amp;lt;HR&amp;gt; tag. Add a newline character at the end.
     */
    public void hr() {
        println("&lt;HR&gt;");
    }

    /**
     * Print &amp;lt;HR SIZE="size" WIDTH="widthpercent%"&amp;gt; tag. Add a newline 
     * character at the end.
     *
     * @param size           Size of the ruler.
     * @param widthPercent   Percentage Width of the ruler
     */
    public void hr(int size, int widthPercent) {
        println("&lt;HR SIZE=\"" + size + "\" WIDTH=\"" + widthPercent + "%\"&gt;");
    }

    /**
     * Print &amp;lt;HR SIZE="size" NOSHADE&amp;gt; tag. Add a newline character at the end.
     *
     * @param size           Size of the ruler.
     * @param noshade        noshade string.
     */
    public void hr(int size, String noshade) {
        println("&lt;HR SIZE=\"" + size + "\" NOSHADE&gt;");
    }

    /**
     * Get the "&amp;lt;B&amp;gt;" string.
     *
     * @return String Return String "&amp;lt;B&amp;gt;";
     */
    public String getBold() {
        return "&lt;B&gt;";
    }

    /**
     * Get the "&amp;lt;/B&amp;gt;" string.
     *
     * @return String Return String "&amp;lt;/B&amp;gt;";
     */
    public String getBoldEnd() {
        return "&lt;/B&gt;";
    }

    /**
     * Print &amp;lt;B&amp;gt; tag.
     */
    public void bold() {
        print("&lt;B&gt;");
    }

    /**
     * Print &amp;lt;/B&amp;gt; tag.
     */
    public void boldEnd() {
        print("&lt;/B&gt;");
    }

    /**
     * Print text passed, in bold format using &amp;lt;B&amp;gt; and &amp;lt;/B&amp;gt; tags.
     * 
     * @param text String to be printed in between &amp;lt;B&amp;gt; and &amp;lt;/B&amp;gt; tags.
     */
    public void bold(String text) {
        bold();
        print(text);
        boldEnd();
    }
    
    /**
     * Print text passed, in Italics using &amp;lt;I&amp;gt; and &amp;lt;/I&amp;gt; tags.
     * 
     * @param text String to be printed in between &amp;lt;I&amp;gt; and &amp;lt;/I&amp;gt; tags.
     */
    public void italics(String text) {
        print("&lt;I&gt;");
        print(text);
        println("&lt;/I&gt;");
    }

    /**
     * Return, text passed, with Italics &amp;lt;I&amp;gt; and &amp;lt;/I&amp;gt; tags, surrounding it.
     * So if the text passed is "Hi", then string returned will be "&amp;lt;I&amp;gt;Hi&amp;lt;/I&amp;gt;".
     *
     * @param text String to be printed in between &amp;lt;I&amp;gt; and &amp;lt;/I&amp;gt; tags.
     */
    public String italicsText(String text) {
        return "&lt;I&gt;" + text + "&lt;/I&gt;";
    }

    /**
     * Print "&amp;#38;nbsp;", non-breaking space.
     */
    public void space() {
        print("&amp;nbsp;");
    }

    /**
     * Print &amp;lt;DL&amp;gt; tag. Add a newline character at the end.
     */        
    public void dl() {
        println("&lt;DL&gt;");
    }

    /**
     * Print &amp;lt;/DL&amp;gt; tag. Add a newline character at the end.
     */
    public void dlEnd() {
        println("&lt;/DL&gt;");
    }

    /**
     * Print &amp;lt;DT&amp;gt; tag. 
     */         
    public void dt() {
        print("&lt;DT&gt;");
    }

    /**
     * Print &amp;lt;DT&amp;gt; tag. 
     */  
    public void dd() {
        print("&lt;DD&gt;");
    }

    /**
     * Print &amp;lt;/DD&amp;gt; tag. Add a newline character at the end.
     */
    public void ddEnd() {
        println("&lt;/DD&gt;"); 
    }

    /**
     * Print &amp;lt;SUP&amp;gt; tag. Add a newline character at the end.
     */
    public void sup() {
        println("&lt;SUP&gt;");
    }

    /**
     * Print &amp;lt;/SUP&amp;gt; tag. Add a newline character at the end.
     */
    public void supEnd() {
        println("&lt;/SUP&gt;");
    }
    
    /**
     * Print &amp;lt;FONT SIZE="size"&amp;gt; tag. Add a newline character at the end.
     *
     * @param size String size.
     */
    public void font(String size) {
        println("&lt;FONT SIZE=\"" + size + "\"&gt;");
    }

    /**
     * Print &amp;lt;FONT ID="stylename"&amp;gt; tag. Add a newline character at the end.
     *
     * @param stylename String stylename.
     */
    public void fontStyle(String stylename) {
        print("&lt;FONT ID=\"" + stylename + "\"&gt;");
    }
   
    /**
     * Print &amp;lt;FONT SIZE="size" ID="stylename"&amp;gt; tag. Add a newline character 
     * at the end.
     *
     * @param size String size.
     * @param stylename String stylename.
     */ 
    public void fontSizeStyle(String size, String stylename) {
        println("&lt;FONT size=\"" + size + "\" ID=\"" + stylename + "\"&gt;");
    }
    
    /**
     * Print &amp;lt;/FONT&amp;gt; tag. 
     */
    public void fontEnd() {
        print("&lt;/FONT&gt;");
    }
   
    /**
     * Get the "&amp;lt;FONT COLOR="color"&amp;gt;" string.
     *
     * @param color String color.
     * @return String Return String "&amp;lt;FONT COLOR="color"&amp;gt;".
     */
    public String getFontColor(String color) {
        return "&lt;FONT COLOR=\"" + color + "\"&gt;";
    }

    /**
     * Get the "&amp;lt;/FONT&amp;gt;" string.
     *
     * @return String Return String "&amp;lt;/FONT&amp;gt;";
     */
    public String getFontEnd() {
        return "&lt;/FONT&gt;";
    }

    /**
     * Print &amp;lt;CENTER&amp;gt; tag. Add a newline character at the end.
     */    
    public void center() {
        println("&lt;CENTER&gt;");
    }

    /**
     * Print &amp;lt;/CENTER&amp;gt; tag. Add a newline character at the end.
     */
    public void centerEnd() {
        println("&lt;/CENTER&gt;");
    }
    
    /**
     * Print anchor &amp;lt;A NAME="name"&amp;gt; tag. 
     * 
     * @param name Name String.
     */
    public void aName(String name) {
        print("&lt;A NAME=\"" + name + "\"&gt;");
    }

    /**
     * Print &amp;lt;/A&amp;gt; tag. 
     */
    public void aEnd() {
        print("&lt;/A&gt;");
    }

    /**
     * Print &amp;lt;I&amp;gt; tag. 
     */
    public void italic() {
        print("&lt;I&gt;");
    }

    /**
     * Print &amp;lt;/I&amp;gt; tag. 
     */
    public void italicEnd() {
        print("&lt;/I&gt;");
    }

    /**
     * Print contents within anchor &amp;lt;A NAME="name"&amp;gt; tags. 
     *
     * @param name String name.
     * @param content String contents.
     */ 
    public void anchor(String name, String content) {
        aName(name);
        print(content);
        aEnd();
    }

    /**
     * Print anchor &amp;lt;A NAME="name"&amp;gt; and &amp;lt;/A&amp;gt;tags. Print comment string 
     * "&amp;lt;!-- --&amp;gt;" within those tags. 
     *
     * @param name String name.
     */ 
    public void anchor(String name) {
        aName(name);
        print("&lt;!-- --&gt;");
        aEnd();
    }

    /**
     * Print newline and then print &amp;lt;P&amp;gt; tag. Add a newline character at the 
     * end.
     */
    public void p() {
        println();
        println("&lt;P&gt;");
    }

    /**
     * Print newline and then print &amp;lt;BR&amp;gt; tag. Add a newline character at the 
     * end.
     */
    public void br() {
        println();
        println("&lt;BR&gt;");
    }

    /**
     * Print &amp;lt;ADDRESS&amp;gt; tag. Add a newline character at the end.
     */
    public void address() {
        println("&lt;ADDRESS&gt;");
    }

    /**
     * Print &amp;lt;/ADDRESS&amp;gt; tag. Add a newline character at the end.
     */
    public void addressEnd() {
        println("&lt;/ADDRESS&gt;");
    }

    /**
     * Print &amp;lt;HEAD&amp;gt; tag. Add a newline character at the end.
     */    
    public void head() {
        println("&lt;HEAD&gt;");
    }

    /**
     * Print &amp;lt;/HEAD&amp;gt; tag. Add a newline character at the end.
     */
    public void headEnd() {
        println("&lt;/HEAD&gt;");
    }

    /**
     * Print &amp;lt;CODE&amp;gt; tag. 
     */    
    public void code() {
        print("&lt;CODE&gt;");
    }

    /**
     * Print &amp;lt;/CODE&amp;gt; tag. 
     */
    public void codeEnd() {
        print("&lt;/CODE&gt;");
    }
    
    /**
     * Print &amp;lt;EM&amp;gt; tag. Add a newline character at the end.
     */
    public void em() {
        println("&lt;EM&gt;");
    }

    /**
     * Print &amp;lt;/EM&amp;gt; tag. Add a newline character at the end.
     */
    public void emEnd() {
        println("&lt;/EM&gt;");
    }

    /**
     * Print HTML &amp;lt;TABLE BORDER="border" WIDTH="width" 
     * CELLPADDING="cellpadding" CELLSPACING="cellspacing"&amp;gt; tag.
     * 
     * @param border       Border size.
     * @param width        Width of the table.
     * @param cellpadding  Cellpadding for the table cells.
     * @param cellspacing  Cellspacing for the table cells.
     */
    public void table(int border, String width, int cellpadding, 
                      int cellspacing) {
        println("\n&lt;TABLE BORDER=\"" + border +
                "\" WIDTH=\"" + width +
                "\" CELLPADDING=\"" + cellpadding +
                "\" CELLSPACING=\"" + cellspacing + "\"&gt;");
    } 
 
    /**
     * Print HTML &amp;lt;TABLE BORDER="border" CELLPADDING="cellpadding" 
     * CELLSPACING="cellspacing"&amp;gt; tag.
     * 
     * @param border       Border size.
     * @param cellpadding  Cellpadding for the table cells.
     * @param cellspacing  Cellspacing for the table cells.
     */   
    public void table(int border, int cellpadding, int cellspacing) {
        println("\n&lt;TABLE BORDER=\"" + border +
                "\" CELLPADDING=\"" + cellpadding +
                "\" CELLSPACING=\"" + cellspacing + "\"&gt;");
    } 

    /**
     * Print HTML &amp;lt;TABLE BORDER="border" WIDTH="width"&amp;gt; 
     * 
     * @param border       Border size.
     * @param width        Width of the table.
     */    
    public void table(int border, String width) {
        println("\n&lt;TABLE BORDER=\"" + border +
                "\" WIDTH=\"" + width + "\"&gt;");
    } 

    /**    
     * Print the HTML table tag with border size 0 and width 100%.
     */
    public void table() {
        table(0, "100%"); 
    } 
    
    /**
     * Print &amp;lt;/TABLE&amp;gt; tag. Add a newline character at the end.
     */
    public void tableEnd() {
        println("&lt;/TABLE&gt;");
    }

    /**
     * Print &amp;lt;TR&amp;gt; tag. Add a newline character at the end.
     */
    public void tr() {
        println("&lt;TR&gt;");
    }

    /**
     * Print &amp;lt;/TR&amp;gt; tag. Add a newline character at the end.
     */
    public void trEnd() {
        println("&lt;/TR&gt;");
    }
   
    /**
     * Print &amp;lt;TD&amp;gt; tag. 
     */
    public void td() {
        print("&lt;TD&gt;");
    }

    /**
     * Print &amp;lt;TD NOWRAP&amp;gt; tag. 
     */
    public void tdNowrap() {
        print("&lt;TD NOWRAP&gt;");
    }

    /**
     * Print &amp;lt;TD WIDTH="width"&amp;gt; tag. 
     * 
     * @param width String width.
     */
    public void tdWidth(String width) {
        print("&lt;TD WIDTH=\"" + width + "\"&gt;");
    }

    /**
     * Print &amp;lt;/TD&amp;gt; tag. Add a newline character at the end.
     */
    public void tdEnd() {
        println("&lt;/TD&gt;");
    }

    /**
     * Print &amp;lt;LINK str&amp;gt; tag. 
     * 
     * @param str String.
     */
    public void link(String str) {
        println("&lt;LINK " + str + "&gt;");
    }

    /**
     * Print "&amp;lt;!-- " comment start string. 
     */
    public void commentStart() {
         print("&lt;!-- ");
    }
 
    /**
     * Print "--&amp;gt;" comment end string. Add a newline character at the end.
     */
    public void commentEnd() {
         println("--&gt;");
    }

    /**
     * Print &amp;lt;TR BGCOLOR="color" ID="stylename"&amp;gt; tag. Adds a newline character
     * at the end.
     *
     * @param color String color.
     * @param stylename String stylename.
     */ 
    public void trBgcolorStyle(String color, String stylename) {
        println("&lt;TR BGCOLOR=\"" + color + "\" ID=\"" + stylename + "\"&gt;");
    }

    /**
     * Print &amp;lt;TR BGCOLOR="color"&amp;gt; tag. Adds a newline character at the end.
     *
     * @param color String color.
     */
    public void trBgcolor(String color) {
        println("&lt;TR BGCOLOR=\"" + color + "\"&gt;");
    }

    /**
     * Print &amp;lt;TR ALIGN="align" VALIGN="valign"&amp;gt; tag. Adds a newline character
     * at the end.
     *
     * @param align String align.
     * @param valign String valign.
     */
    public void trAlignVAlign(String align, String valign) {
        println("&lt;TR ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\"&gt;");
    }

    /**
     * Print &amp;lt;TD COLSPAN=i&amp;gt; tag. 
     *
     * @param i integer.
     */
    public void tdColspan(int i) {
        print("&lt;TD COLSPAN=" + i + "&gt;");
    }

    /**
     * Print &amp;lt;TD BGCOLOR="color" ID="stylename"&amp;gt; tag. 
     *
     * @param color String color.
     * @param stylename String stylename.
     */ 
    public void tdBgcolorStyle(String color, String stylename) {
        print("&lt;TD BGCOLOR=\"" + color + "\" ID=\"" + stylename + "\"&gt;");
    }
 
    /**
     * Print &amp;lt;TD COLSPAN=i BGCOLOR="color" ID="stylename"&amp;gt; tag. 
     *
     * @param i integer.
     * @param color String color.
     * @param stylename String stylename.
     */        
    public void tdColspanBgcolorStyle(int i, String color, String stylename) {
        print("&lt;TD COLSPAN=" + i + " BGCOLOR=\"" + color + "\" ID=\"" +
              stylename + "\"&gt;");
    }

    /**
     * Print &amp;lt;TD ALIGN="align"&amp;gt; tag. Adds a newline character
     * at the end.
     *
     * @param align String align.
     */        
    public void tdAlign(String align) {
        print("&lt;TD ALIGN=\"" + align + "\"&gt;");
    }

    /**
     * Print &amp;lt;TD ALIGN="align" ID="stylename"&amp;gt; tag.
     *
     * @param align        String align.
     * @param stylename    String stylename.
     */
    public void tdVAlignClass(String align, String stylename) {
        print("&lt;TD VALIGN=\"" + align + "\" ID=\"" + stylename + "\"&gt;");
    }

    /**
     * Print &amp;lt;TD VALIGN="valign"&amp;gt; tag. 
     *
     * @param valign String valign.
     */
    public void tdVAlign(String valign) {
        print("&lt;TD VALIGN=\"" + valign + "\"&gt;");
    }

    /**
     * Print &amp;lt;TD ALIGN="align" VALIGN="valign"&amp;gt; tag. 
     *
     * @param align   String align.
     * @param valign  String valign.
     */
    public void tdAlignVAlign(String align, String valign) {
        print("&lt;TD ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\"&gt;");
    }

    /**
     * Print &amp;lt;TD ALIGN="align" ROWSPAN=rowspan&amp;gt; tag. 
     *
     * @param align    String align.
     * @param rowspan  integer rowspan.
     */
    public void tdAlignRowspan(String align, int rowspan) {
        print("&lt;TD ALIGN=\"" + align + "\" ROWSPAN=" + rowspan + "&gt;");
    }

    /**
     * Print &amp;lt;TD ALIGN="align" VALIGN="valign" ROWSPAN=rowspan&amp;gt; tag. 
     *
     * @param align    String align.
     * @param valign  String valign.
     * @param rowspan  integer rowspan.
     */
    public void tdAlignVAlignRowspan(String align, String valign, 
                                     int rowspan) {
        print("&lt;TD ALIGN=\"" + align + "\" VALIGN=\"" + valign 
                + "\" ROWSPAN=" + rowspan + "&gt;");
    }

    /**
     * Print &amp;lt;BLOCKQUOTE&amp;gt; tag. Add a newline character at the end.
     */
    public void blockquote() {
        println("&lt;BLOCKQUOTE&gt;");
    }

    /**
     * Print &amp;lt;/BLOCKQUOTE&amp;gt; tag. Add a newline character at the end.
     */
    public void blockquoteEnd() {
        println("&lt;/BLOCKQUOTE&gt;");
    }

    /**
     * Get the "&amp;lt;CODE&amp;gt;" string.
     *
     * @return String Return String "&amp;lt;CODE&gt;";
     */
    public String getCode() {
        return "&lt;CODE&gt;";
    }

    /**
     * Get the "&amp;lt;/CODE&amp;gt;" string.
     *
     * @return String Return String "&amp;lt;/CODE&amp;gt;";
     */
    public String getCodeEnd() {
        return "&lt;/CODE&gt;";
    }
 
    /**
     * Print &amp;lt;NOFRAMES&amp;gt; tag. Add a newline character at the end.
     */
    public void noFrames() {
        println("&lt;NOFRAMES&gt;");
    }

    /**
     * Print &amp;lt;/NOFRAMES&amp;gt; tag. Add a newline character at the end.
     */
    public void noFramesEnd() {
        println("&lt;/NOFRAMES&gt;");
    }
}
</pre></body></html>