de.prob.prolog.output.PrologTermStringOutput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prologlib Show documentation
Show all versions of prologlib Show documentation
Part of the ProB Parser library
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