/*
 * Encog(tm) Core v3.4 - Java Version
 * http://www.heatonresearch.com/encog/
 * https://github.com/encog/encog-java-core
 
 * Copyright 2008-2016 Heaton Research, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *   
 * For more information on Heaton Research copyrights, licenses 
 * and trademarks visit:
 * http://www.heatonresearch.com/copyright
 */
package org.encog.util;

public class HTMLReport {
	private StringBuilder text = new StringBuilder();

	public void beginHTML() {
		text.append("");
	}

	public void endHTML() {
		text.append("");
	}

	public void title(String str) {
		text.append("");
		text.append(str);
		text.append("");
	}

	public void beginPara() {
		text.append("

"); } public void endPara() { text.append("

"); } public void bold(String str) { text.append(""); text.append(encode(str)); text.append(""); } public void para(String str) { text.append("

"); text.append(encode(str)); text.append("

"); } public void clear() { this.text.setLength(0); } public String toString() { return this.text.toString(); } public void beginBody() { text.append(""); } public void endBody() { text.append(""); } public void h1(String title) { text.append("

"); text.append(encode(title)); text.append("

"); } public void beginTable() { text.append(""); } public void endTable() { text.append("
"); } public void beginRow() { text.append(""); } public void endRow() { text.append(""); } public void header(String head) { text.append(""); text.append(encode(head)); text.append(""); } public void cell(String head) { cell(head,0); } public void cell(String head, int colSpan) { text.append(" 0) { text.append(" colspan=\""); text.append(colSpan); text.append("\""); } text.append(">"); text.append(encode(head)); text.append(""); } public void tablePair(String name, String value) { beginRow(); text.append("" + encode(name) + ""); cell(value); endRow(); } public static String encode(String str) { StringBuilder result = new StringBuilder(); for(int i=0;i' ) { result.append(">"); } else if( ch=='&' ) { result.append("&"); } else { result.append(ch); } } return result.toString(); } public void h2(String title) { text.append("

"); text.append(encode(title)); text.append("

"); } public void h3(String title) { text.append("

"); text.append(encode(title)); text.append("

"); } public void beginList() { text.append("
    "); } public void listItem(String str) { text.append("
  • "); text.append(encode(str)); } public void endList() { text.append("
"); } public void beginTableInCell(int colSpan) { text.append(" 0) { text.append(" colspan=\""); text.append(colSpan); text.append("\""); } text.append(">"); text.append(""); } public void endTableInCell() { text.append("
"); } public void header(String head, int colSpan) { text.append(" 0) { text.append(" colspan=\""); text.append(colSpan); text.append("\""); } text.append(">"); text.append(encode(head)); text.append(""); } }

Ads help maintain this website.