org.eclipse.ease

## Class ScriptResult

- java.lang.Object
- - org.eclipse.ease.ScriptResult

    public class ScriptResult
    extends java.lang.Object

A ScriptResult is a container for a script execution. As execution often occurs detached from the System thread, the result object contains an indicator for pending and finished results. Results itself may contain an object or an exception.

### Field Summary

Fields
`static java.lang.Object` `VOID` Special void object for script methods not returning a result.

### Constructor Summary

Constructors
Constructor and Description
`ScriptResult()` Constructor of a pending execution.
`ScriptResult(java.lang.Object result)` Constructor for a finished execution.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.Throwable` `getException()` Get the exception stored within this result.
`java.lang.Object` `getResult()` Get the result value stored.
`boolean` `hasException()` Checks whether this result contains an exception.
`boolean` `isReady()` Verify that this ScriptResult is processed.
`void` `setException(java.lang.Throwable e)` Set an exception to be stored for this result.
`void` `setResult(java.lang.Object result)` Set the result to be stored.
`java.lang.String` `toString()`
`void` `waitForResult()` Blocks execution until the execution result is ready.
`void` `waitForResult(long timeout)` Blocks execution until the execution result is ready or the timeout is reached.

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

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

### Field Detail

#### VOID

    public static final java.lang.Object VOID

Special void object for script methods not returning a result.

### Constructor Detail

#### ScriptResult

    public ScriptResult()

Constructor of a pending execution.

#### ScriptResult

    public ScriptResult(java.lang.Object result)

Constructor for a finished execution.

Parameters:
  `result` - result of execution

### Method Detail

#### isReady

    public final boolean isReady()

Verify that this ScriptResult is processed. If the result is ready, execution of the underlying script is done.

Returns:
  true when processing is done

#### waitForResult

    public final void waitForResult()

Blocks execution until the execution result is ready.

#### waitForResult

    public final void waitForResult(long timeout)

Blocks execution until the execution result is ready or the timeout is reached. Once this method returns you still need to query `isReady()` as the timeout might have depleted.

Parameters:
  `timeout` - the maximum time to wait in milliseconds.

#### getResult

    public final java.lang.Object getResult()

Get the result value stored.

Returns:
  result value

#### setResult

    public final void setResult(java.lang.Object result)

Set the result to be stored.

Parameters:
  `result` - object to be stored

#### setException

    public final void setException(java.lang.Throwable e)

Set an exception to be stored for this result.

Parameters:
  `e` - exception to be stored

#### getException

    public final java.lang.Throwable getException()

Get the exception stored within this result.

Returns:
  stored exception or null

#### toString

    public final java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### hasException

    public final boolean hasException()

Checks whether this result contains an exception.

Returns:
  true when this result contains an exception