public class RCaller extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
RCaller(RCode rCode,
ROutputParser parser,
RStreamHandler rOutput,
RStreamHandler rError,
MessageSaver messageSaver,
TempFileService tempFileService,
RCallerOptions rCallerOptions) |
| Modifier and Type | Method and Description |
|---|---|
static RCaller |
create() |
static RCaller |
create(RCallerOptions rCallerOptions) |
static RCaller |
create(RCode rcode,
RCallerOptions rCallerOptions) |
void |
deleteTempFiles() |
String |
getCranRepos() |
ROutputParser |
getParser() |
RCallerOptions |
getRCallerOptions() |
RCode |
getRCode() |
void |
redirectROutputToFile(String name,
boolean appendToExisting) |
void |
redirectROutputToStream(OutputStream o) |
void |
runAndReturnResult(String var)
Runs the current code and returns the R variable "var".
|
void |
runAndReturnResultOnline(String var)
Runs the current code in the existing R instance (or in a new one) and
returns the R variable "var".
|
void |
runOnly()
Executes the code contained in this RCaller instance in s separate
process.
|
void |
setGraphicsTheme(GraphicsTheme theme) |
void |
setRCode(RCode rcode) |
void |
startStreamConsumers(Process process) |
void |
StopRCallerOnline() |
boolean |
stopStreamConsumers()
Stops the threads that are emptying the output and error streams of the
live but idle R process.
|
protected RCaller(RCode rCode, ROutputParser parser, RStreamHandler rOutput, RStreamHandler rError, MessageSaver messageSaver, TempFileService tempFileService, RCallerOptions rCallerOptions)
public static RCaller create()
public static RCaller create(RCallerOptions rCallerOptions)
public static RCaller create(RCode rcode, RCallerOptions rCallerOptions)
public boolean stopStreamConsumers()
public void startStreamConsumers(Process process)
public String getCranRepos()
public ROutputParser getParser()
public RCode getRCode()
public void setRCode(RCode rcode)
public void setGraphicsTheme(GraphicsTheme theme)
public void deleteTempFiles()
public void runOnly()
throws ExecutionException
ExecutionException - if R cannot be run for some
reasonpublic void runAndReturnResultOnline(String var) throws ExecutionException
var - The R variable to returnExecutionException - if R cannot be startedstopStreamConsumers()public void StopRCallerOnline()
public void runAndReturnResult(String var) throws ExecutionException
var - the R variable to returnExecutionException - if R could be started; if a
temporary file to store the results could not be created; if the
temporary file is corrupt. The exact cause will be added to the stack
tracepublic void redirectROutputToFile(String name, boolean appendToExisting) throws FileNotFoundException
FileNotFoundExceptionpublic void redirectROutputToStream(OutputStream o)
public RCallerOptions getRCallerOptions()
Copyright © 2016. All rights reserved.