R
- The type of the result objectH
- The type of the result history item (CodeEvaluator.Result.DefaultHistoryItem
can be used).public static final class CodeEvaluator.Result<R,H> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CodeEvaluator.Result.DefaultHistoryItem
A default implementation of a history item.
|
static interface |
CodeEvaluator.Result.Listener<R>
Listener that is notified when result changes.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(CodeEvaluator.Result.Listener<R> l)
Add a result change listener.
|
static <R,H> CodeEvaluator.Result<R,H> |
get(DebuggerEngine engine)
Get an instance of Result for the given
DebuggerEngine . |
String |
getExpression()
Get the current expression.
|
List<H> |
getHistoryItems()
Get the history items.
|
R |
getResult()
Get the current result.
|
void |
removeListener(CodeEvaluator.Result.Listener<R> l)
Remove a result change listener.
|
void |
setAndOpen(String expression,
R result,
H historyItem)
Set the current expression, it's result and a history item, that is
added to the list of history items upon the next evaluation.
|
void |
setMaxHistoryItems(int maxHistoryItems)
Set the maximum number of result history items being held.
|
public static <R,H> CodeEvaluator.Result<R,H> get(DebuggerEngine engine)
DebuggerEngine
.
A new instance is created if there is not one available, an existing
instance is returned otherwise.R
- The type of the result objectH
- The type of the result history itemengine
- The debugger enginepublic void setMaxHistoryItems(int maxHistoryItems)
maxHistoryItems
- maximum number of history itemspublic void setAndOpen(String expression, R result, H historyItem)
expression
- The evaluated expressionresult
- The result of that expressionhistoryItem
- A history representation of the resultpublic String getExpression()
CodeEvaluator.Result.setAndOpen(java.lang.String, java.lang.Object, java.lang.Object)
public R getResult()
CodeEvaluator.Result.setAndOpen(java.lang.String, java.lang.Object, java.lang.Object)
public void addListener(CodeEvaluator.Result.Listener<R> l)
l
- result change listenerpublic void removeListener(CodeEvaluator.Result.Listener<R> l)
l
- result change listener