All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.prob.prolog.output.PrologTermStringOutput Maven / Gradle / Ivy

There is a newer version: 2.13.5
Show newest version
package de.prob.prolog.output;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * This class encapsulates the process of creating a Prolog Term as a String.
 */
public class PrologTermStringOutput extends PrologTermDelegate {
	private final StringWriter sw;

	public PrologTermStringOutput() {
		this(new StringWriter());
	}

	private PrologTermStringOutput(StringWriter sw) {
		super(new PrologTermOutput(new PrintWriter(sw), false));
		this.sw = sw;
	}

	public IPrologTermOutput getPrologTermOutput() {
		return pto;
	}

	@Override
	public String toString() {
		pto.flush();
		return sw.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy