From 9e805295cca9c4de6b3e4223c99ca0926b09058c Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Mon, 4 Jan 2016 17:04:49 +0000 Subject: [PATCH] NBA: print(out, format) method, like for DA This allows specification of the output format later on via the command line. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11106 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/jltl2dstar/NBA.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/prism/src/jltl2dstar/NBA.java b/prism/src/jltl2dstar/NBA.java index 4442134c..0c7d989a 100644 --- a/prism/src/jltl2dstar/NBA.java +++ b/prism/src/jltl2dstar/NBA.java @@ -21,7 +21,10 @@ package jltl2dstar; import java.util.*; + import prism.PrismException; +import prism.PrismNotSupportedException; + import java.io.PrintStream; import jltl2ba.APElement; @@ -233,6 +236,28 @@ public class NBA implements Iterable { return product_nba; } + /** + * Print automaton to a PrintStream in a specified format ("dot", "txt", "lbtt" or "hoa"). + */ + public void print(PrintStream out, String type) throws PrismException + { + switch (type) { + case "txt": + print(out); + break; + case "dot": + print_dot(out); + break; + case "lbtt": + print_lbtt(out); + case "hoa": + print_hoa(out); + break; + default: + throw new PrismNotSupportedException("Can not print NBA in '"+type+"' format"); + } + } + /** * Print the NBA on the output stream. */