Search in sources :

Example 1 with DefaultConsoleIterator

use of com.sri.ai.util.console.DefaultConsoleIterator in project aic-expresso by aic-sri-international.

the class SymbolicShell method getConsole.

private static ConsoleIterator getConsole(String[] args) {
    ConsoleIterator result = null;
    OptionParser parser = new OptionParser();
    OptionSpec<String> consoleType = parser.accepts("console", "Console type <gui> or <default>").withRequiredArg().ofType(String.class);
    OptionSet options = parser.parse(args);
    if (options.has(consoleType)) {
        if ("gui".equalsIgnoreCase(options.valueOf(consoleType))) {
            result = new GUIConsoleIterator();
        }
    }
    if (result == null) {
        result = new DefaultConsoleIterator();
    }
    return result;
}
Also used : DefaultConsoleIterator(com.sri.ai.util.console.DefaultConsoleIterator) GUIConsoleIterator(com.sri.ai.util.console.gui.GUIConsoleIterator) ConsoleIterator(com.sri.ai.util.console.ConsoleIterator) DefaultConsoleIterator(com.sri.ai.util.console.DefaultConsoleIterator) GUIConsoleIterator(com.sri.ai.util.console.gui.GUIConsoleIterator) OptionSet(joptsimple.OptionSet) OptionParser(joptsimple.OptionParser)

Example 2 with DefaultConsoleIterator

use of com.sri.ai.util.console.DefaultConsoleIterator in project aic-expresso by aic-sri-international.

the class SymbolicShell method getConsole.

private static ConsoleIterator getConsole(String[] args) {
    ConsoleIterator result = null;
    OptionParser parser = new OptionParser();
    OptionSpec<String> consoleType = parser.accepts("console", "Console type <gui or default>").withRequiredArg().ofType(String.class);
    OptionSet options = parser.parse(args);
    if (options.has(consoleType)) {
        if ("gui".equalsIgnoreCase(options.valueOf(consoleType))) {
            result = new GUIConsoleIterator();
        }
    }
    if (result == null) {
        result = new DefaultConsoleIterator();
    }
    return result;
}
Also used : DefaultConsoleIterator(com.sri.ai.util.console.DefaultConsoleIterator) GUIConsoleIterator(com.sri.ai.util.console.gui.GUIConsoleIterator) ConsoleIterator(com.sri.ai.util.console.ConsoleIterator) DefaultConsoleIterator(com.sri.ai.util.console.DefaultConsoleIterator) GUIConsoleIterator(com.sri.ai.util.console.gui.GUIConsoleIterator) OptionSet(joptsimple.OptionSet) OptionParser(joptsimple.OptionParser)

Aggregations

ConsoleIterator (com.sri.ai.util.console.ConsoleIterator)2 DefaultConsoleIterator (com.sri.ai.util.console.DefaultConsoleIterator)2 GUIConsoleIterator (com.sri.ai.util.console.gui.GUIConsoleIterator)2 OptionParser (joptsimple.OptionParser)2 OptionSet (joptsimple.OptionSet)2