Class OTUtils
- java.lang.Object
-
- de.learnlib.datastructure.observationtable.OTUtils
-
public final class OTUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <I,D>
voiddisplayHTMLInBrowser(ObservationTable<I,D> table)
Convenience method fordisplayHTMLInBrowser(ObservationTable, Function, Function)
that usesObject.toString()
to render words and outputs of the observation table.static <I,D>
voiddisplayHTMLInBrowser(ObservationTable<I,D> table, Function<? super Word<? extends I>,? extends String> wordToString, Function<? super D,? extends String> outputToString)
Displays the observation table as an HTML document in the default browser.static <I,D>
ObservationTable<I,D>fromString(String source, Alphabet<I> alphabet, ObservationTableReader<I,D> reader)
static <I,D>
StringtoString(ObservationTable<I,D> table, ObservationTableWriter<I,D> writer)
static <I,D>
voidwriteHTMLToFile(ObservationTable<I,D> table, File file)
static <I,D>
voidwriteHTMLToFile(ObservationTable<I,D> table, File file, Function<? super Word<? extends I>,? extends String> wordToString, Function<? super D,? extends String> outputToString)
-
-
-
Method Detail
-
toString
public static <I,D> String toString(ObservationTable<I,D> table, ObservationTableWriter<I,D> writer)
-
fromString
public static <I,D> ObservationTable<I,D> fromString(String source, Alphabet<I> alphabet, ObservationTableReader<I,D> reader)
-
writeHTMLToFile
public static <I,D> void writeHTMLToFile(ObservationTable<I,D> table, File file) throws IOException
- Throws:
IOException
-
writeHTMLToFile
public static <I,D> void writeHTMLToFile(ObservationTable<I,D> table, File file, Function<? super Word<? extends I>,? extends String> wordToString, Function<? super D,? extends String> outputToString) throws IOException
- Throws:
IOException
-
displayHTMLInBrowser
public static <I,D> void displayHTMLInBrowser(ObservationTable<I,D> table) throws IOException
Convenience method fordisplayHTMLInBrowser(ObservationTable, Function, Function)
that usesObject.toString()
to render words and outputs of the observation table.- Throws:
IOException
-
displayHTMLInBrowser
public static <I,D> void displayHTMLInBrowser(ObservationTable<I,D> table, Function<? super Word<? extends I>,? extends String> wordToString, Function<? super D,? extends String> outputToString) throws IOException
Displays the observation table as an HTML document in the default browser.This method internally relies on
Desktop.browse(java.net.URI)
, hence it will not work ifDesktop
is not supported, or if the application is running in headless mode.IMPORTANT NOTE: Calling this method may delay the termination of the JVM by up to 5 seconds. This is due to the fact that the temporary file created in this method is marked for deletion upon JVM termination. If the JVM terminates too early, it might be deleted before it was loaded by the browser.
- Parameters:
table
- the observation table to displaywordToString
- the transformation from words to strings. This transformation is not required nor expected to escape HTML entitiesoutputToString
- the transformation from outputs to strings. This transformation is not required nor expected to escape HTML entities- Throws:
IOException
- if creating or writing to the temporary file failsHeadlessException
- if the JVM is running in headless modeUnsupportedOperationException
- ifDesktop.getDesktop()
is not supported by the system
-
-