org.eclipse.ease

## Class AbstractReplScriptEngine

- java.lang.Object
- - org.eclipse.core.runtime.PlatformObject
  - - org.eclipse.core.internal.jobs.InternalJob
    - - org.eclipse.core.runtime.jobs.Job
      - - org.eclipse.ease.AbstractScriptEngine
        - - org.eclipse.ease.AbstractReplScriptEngine

All Implemented Interfaces:
  java.lang.Comparable, IAdaptable, IReplEngine, IScriptEngine

Direct Known Subclasses:
  JythonScriptEngine, NashornScriptEngine, Py4jScriptEngine, RhinoScriptEngine

    public abstract class AbstractReplScriptEngine
    extends AbstractScriptEngine
    implements IReplEngine

Adds generic REPL support to the AbstractScriptEngine.

### Field Summary

### Fields inherited from class org.eclipse.core.runtime.jobs.Job

`ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING`

### Fields inherited from interface org.eclipse.ease.IScriptEngine

`TRACE_SCRIPT_ENGINE`

### Constructor Summary

Constructors
Constructor and Description
`AbstractReplScriptEngine(java.lang.String name)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.Collection<EaseDebugVariable>` `getDefinedVariables()` Get variables defined on the top level scope of the script engine.
`EaseDebugVariable` `getLastExecutionResult()` Get the result of the last script execution.
`boolean` `getTerminateOnIdle()` Get termination condition when engine is idle.
`ScriptObjectType` `getType(java.lang.Object object)` Get type information on a given script object
`boolean` `isIdle()` Get idle status of the interpreter.
`void` `setTerminateOnIdle(boolean terminate)` Set a marker that the interpreter should terminate instead entering IDLE mode.
`void` `terminate()` Terminate this interpreter.
`java.lang.String` `toString(java.lang.Object object)` Get the String representation of a script object.

### Methods inherited from class org.eclipse.ease.AbstractScriptEngine

`addExecutionListener, addSecurityCheck, executeAsync, executeSync, extractArguments, getCurrentScriptEngine, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getOutputStream, getStackTrace, getVariable, getVariables, hasVariable, inject, injectUI, isFinished, join, removeExecutionListener, removeSecurityCheck, setCloseStreamsOnTerminate, setEngineDescription, setErrorStream, setExecutionRootFile, setInputStream, setLaunch, setOutputStream, setVariable`

### Methods inherited from class org.eclipse.core.runtime.jobs.Job

`addJobChangeListener, belongsTo, cancel, create, create, createSystem, createSystem, createSystem, done, getJobGroup, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, join, removeJobChangeListener, schedule, schedule, setJobGroup, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule`

### Methods inherited from class org.eclipse.core.internal.jobs.InternalJob

`compareTo`

### Methods inherited from class org.eclipse.core.runtime.PlatformObject

`getAdapter`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.ease.IScriptEngine

`addExecutionListener, addSecurityCheck, executeAsync, executeSync, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getName, getOutputStream, getVariable, getVariables, hasVariable, inject, injectUI, isFinished, join, registerJar, removeExecutionListener, removeSecurityCheck, schedule, setCloseStreamsOnTerminate, setErrorStream, setInputStream, setOutputStream, setVariable, terminateCurrent`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

### Constructor Detail

#### AbstractReplScriptEngine

    public AbstractReplScriptEngine(java.lang.String name)

Constructor. Sets the name for the underlying job.

Parameters:
  `name` - name of script engine job

### Method Detail

#### setTerminateOnIdle

    public final void setTerminateOnIdle(boolean terminate)

Description copied from interface: `IReplEngine`
Set a marker that the interpreter should terminate instead entering IDLE mode. If set, the interpreter will execute all pending requests and terminate afterwards.

Specified by:
  `setTerminateOnIdle` in interface `IReplEngine`
Parameters:
  `terminate` - `true` to request termination

#### getTerminateOnIdle

    public boolean getTerminateOnIdle()

Description copied from interface: `IReplEngine`
Get termination condition when engine is idle.

Specified by:
  `getTerminateOnIdle` in interface `IReplEngine`
Returns:
  `true` when engine is terminated when idle

#### isIdle

    public boolean isIdle()

Get idle status of the interpreter. The interpreter is IDLE if there are no pending execution requests and the interpreter is not terminated.

Specified by:
  `isIdle` in interface `IReplEngine`
Returns:
  true if interpreter is IDLE

#### terminate

    public void terminate()

Description copied from interface: `IScriptEngine`
Terminate this interpreter. Addresses a request to terminate current script execution. When the request will be handled is implementation specific.

Specified by:
  `terminate` in interface `IScriptEngine`
Overrides:
  `terminate` in class `AbstractScriptEngine`

#### getDefinedVariables

    public java.util.Collection<EaseDebugVariable> getDefinedVariables()

Description copied from interface: `IReplEngine`
Get variables defined on the top level scope of the script engine.

Specified by:
  `getDefinedVariables` in interface `IReplEngine`
Returns:
  defined variables

#### getType

    public ScriptObjectType getType(java.lang.Object object)

Description copied from interface: `IReplEngine`
Get type information on a given script object

Specified by:
  `getType` in interface `IReplEngine`
Parameters:
  `object` - object to inspect
Returns:
  object type

#### toString

    public java.lang.String toString(java.lang.Object object)

Description copied from interface: `IReplEngine`
Get the String representation of a script object. A script object can be an execution result or a variable content.

Specified by:
  `toString` in interface `IReplEngine`
Parameters:
  `object` - script object
Returns:
  String representation

#### getLastExecutionResult

    public EaseDebugVariable getLastExecutionResult()

Description copied from interface: `IReplEngine`
Get the result of the last script execution.

Specified by:
  `getLastExecutionResult` in interface `IReplEngine`
Returns:
  script result of last execution