org.scijava.script
Interface ScriptInterpreter

All Known Implementing Classes:
DefaultScriptInterpreter

public interface ScriptInterpreter

The contract for script interpreters.

Author:
Johannes Schindelin

Method Summary
 void eval(String command)
          Evaluates a command.
 ScriptEngine getEngine()
          Returns the associated ScriptEngine.
 ScriptLanguage getLanguage()
          Returns the associated ScriptLanguage.
 void readHistory()
          Reads the persisted history of the current script interpreter.
 String walkHistory(String currentCommand, boolean forward)
          Obtains the next/previous command in the command history.
 void writeHistory()
          Persists the history of the current script interpreter.
 

Method Detail

readHistory

void readHistory()
Reads the persisted history of the current script interpreter.


writeHistory

void writeHistory()
Persists the history of the current script interpreter.


walkHistory

String walkHistory(String currentCommand,
                   boolean forward)
Obtains the next/previous command in the command history.

Parameters:
currentCommand - the current command (will be stored in the history)
forward - if true, the next history entry is returned (more recent), if false, the previous one
Returns:
the next/previous command

eval

void eval(String command)
          throws ScriptException
Evaluates a command.

Parameters:
command - the command to evaluate
Throws:
ScriptException

getLanguage

ScriptLanguage getLanguage()
Returns the associated ScriptLanguage.


getEngine

ScriptEngine getEngine()
Returns the associated ScriptEngine.

Returns:
the script engine


Copyright © 2009–2014 SciJava. All rights reserved.