@ParametersAreNonnullByDefault public final class OTUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <I,D> void |
displayHTMLInBrowser(ObservationTable<I,D> table) |
static <I,D> void |
displayHTMLInBrowser(ObservationTable<I,D> table,
Function<? super net.automatalib.words.Word<? extends I>,? extends String> wordToString,
Function<? super D,? extends String> outputToString)
Displays the observation table as a HTML document in the default browser.
|
static <I,D> ObservationTable<I,D> |
fromString(String source,
net.automatalib.words.Alphabet<I> alphabet,
ObservationTableReader<I,D> reader) |
static <I,D> String |
toString(ObservationTable<I,D> table,
ObservationTableWriter<I,D> writer) |
static <I,D> void |
writeHTMLToFile(ObservationTable<I,D> table,
File file) |
static <I,D> void |
writeHTMLToFile(ObservationTable<I,D> table,
File file,
Function<? super net.automatalib.words.Word<? extends I>,? extends String> wordToString,
Function<? super D,? extends String> outputToString) |
public static <I,D> String toString(ObservationTable<I,D> table, ObservationTableWriter<I,D> writer)
public static <I,D> ObservationTable<I,D> fromString(String source, net.automatalib.words.Alphabet<I> alphabet, ObservationTableReader<I,D> reader)
public static <I,D> void writeHTMLToFile(ObservationTable<I,D> table, File file) throws IOException
IOException
public static <I,D> void writeHTMLToFile(ObservationTable<I,D> table, File file, Function<? super net.automatalib.words.Word<? extends I>,? extends String> wordToString, Function<? super D,? extends String> outputToString) throws IOException
IOException
public static <I,D> void displayHTMLInBrowser(ObservationTable<I,D> table) throws IOException, UnsupportedOperationException
public static <I,D> void displayHTMLInBrowser(ObservationTable<I,D> table, Function<? super net.automatalib.words.Word<? extends I>,? extends String> wordToString, Function<? super D,? extends String> outputToString) throws IOException, UnsupportedOperationException
This method internally relies on Desktop.browse(java.net.URI)
, hence it will not work if Desktop
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.
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 entitiesIOException
- if creating or writing to the temporary file failsHeadlessException
- if the JVM is running in headless modeUnsupportedOperationException
- if Desktop.getDesktop()
is not supported by the systemCopyright © 2018. All rights reserved.