|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.ext.R.R
public final class R
This class is used to access the R engine safely. To use the engine, it must first be locked. This grants sole access to the one holding the key. The key must be supplied for each evaluation. When finished using the engine, the key-holder should unlock it. The R engine cannot be stopped after it has been started, except by Runtime.exit(int).
Method Summary | |
---|---|
static org.rosuda.JRI.REXP |
eval(java.lang.String statement,
java.lang.Object key)
Evaluates the provided R command. |
static boolean |
isKey(java.lang.Object potentialKey)
Indicates if the provided object is the key to unlock the R engine. |
static boolean |
isLocked()
Indicates if the R engine is currently locked. |
static java.lang.Object |
lock()
Locks the R engine so that no one can use it without the key. |
static void |
startR()
Starts the R engine if it is not already running. |
static void |
unlock(java.lang.Object key)
Unlocks the R engine so that others have access, that is, someone can request a new key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isLocked()
true
if the R engine is locked, false
othewise.public static boolean isKey(java.lang.Object potentialKey)
potentialKey
- the potential key object.
true
if the provided object can unlock the R engine,
false
otherwise.public static java.lang.Object lock()
public static void unlock(java.lang.Object key)
key
- the key that fits the current lock.public static org.rosuda.JRI.REXP eval(java.lang.String statement, java.lang.Object key)
statement
- the R command to be evaluated.key
- the key required to unlock the R engine.
java.lang.IllegalArgumentException
- if the provided key does not fit the lock.
JriException
- if the R engine throws an exception.public static void startR()
JriException
- if an exception is thrown while attempting to start
the R engine.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |