|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.j2r.REngineAbstract
org.nuiton.j2r.net.RNetEngine
public class RNetEngine
This class represents the network engine to access R. By default, it tries to
connect on address 127.0.0.1 and port 6311. Meanwhile, it is possible to
parametrize it.
You only need to replace the launch option -DR.type=net by
-DR.type=net://192.168.99.122:6312 where 192.168.99.122 is the
distant machine adress and 6312 the port on which the server is running.
| Field Summary | |
|---|---|
static String |
DEFAULT_HOST
|
static int |
DEFAULT_PORT
|
| Constructor Summary | |
|---|---|
RNetEngine()
|
|
| Method Summary | |
|---|---|
void |
commit()
Method to commit all the R expressions stored while in non-autocommit mode |
Object |
eval(String expr)
Method to send a R instruction to the engine and get back the result. |
boolean |
init()
Initialize the engine. |
boolean |
init(String host,
int port)
Method to initialize the connection with specified host and port. |
void |
terminate()
Terminate the connection with the server. |
void |
voidEval(String expr)
Method to send a R instruction to the engine without getting back the result. |
| Methods inherited from class org.nuiton.j2r.REngineAbstract |
|---|
clearSession, cp, dget, dget, dput, dput, getwd, isAutoCommit, loadRData, loadRData, loadRData, ls, mv, remove, saveRData, saveRData, saveRData, setAutoCommit, setwd |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.nuiton.j2r.REngine |
|---|
clearSession, cp, dget, dget, dput, dput, getwd, isAutoCommit, loadRData, loadRData, loadRData, ls, mv, remove, saveRData, saveRData, saveRData, setAutoCommit, setwd |
| Field Detail |
|---|
public static final int DEFAULT_PORT
public static final String DEFAULT_HOST
| Constructor Detail |
|---|
public RNetEngine()
| Method Detail |
|---|
public boolean init()
init in interface REngineREngine.init()
public boolean init(String host,
int port)
host - Adress of the Rserve instanceport - Port on which the Rserve instance is listening.
public Object eval(String expr)
throws RException
eval in interface REngineexpr - the R expression to evaluate.
RException - if an error occur while evaluating the
R expression.REngine.eval(java.lang.String)
public void terminate()
throws RException
terminate in interface REngineRExceptionREngine.terminate()
public void voidEval(String expr)
throws RException
voidEval in interface REngineexpr - The R expression to evaluate.
RExceptionREngine.voidEval(java.lang.String),
commit()
public void commit()
throws RException
commit in interface REngineRException - if an error occur while evaluating one
expression.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||