Logo Search packages:      
Sourcecode: rjava version File versions  Download package

org::rosuda::JRI::Rengine Class Reference

List of all members.


Detailed Description

Rengine class is the interface between an instance of R and the Java VM. Due to the fact that R has no threading support, you can run only one instance of R withing a multi-threaded application. There are two ways to use R from Java: individual call and full event loop. See the Rengine constructor for details.

<u>Important note:</u> All methods starting with rni (R Native Interface) are low-level native methods that should be avoided if a high-level methods exists. They do NOT attempt any synchronization, so it is the duty of the calling program to ensure that the invocation is safe (see getRsync() for details). At some point in the future when the high-level API is complete they should become private. However, currently this high-level layer is not complete, so they are available for now.

All rni methods use long type to reference SEXPs on R side. Those reference should never be modified or used in arithmetics - the only reason for not using an extra interface class to wrap those references is that rni methods are all native methods and therefore it would be too expensive to handle the unwrapping on the C side.

jri methods are called internally by R and invoke the corresponding method from the even loop handler. Those methods should usualy not be called directly.

Since 0.5 a failure to load the JRI naitve library will not be fatal if jri.ignore.ule=yes system preference is set. Rengine will still not work, but that gives a chance to GUI programs to report the error in a more meaningful way (use jriLoaded to check the availability of JRI).

Definition at line 9 of file Rengine.java.


Public Member Functions

void addMainLoopCallbacks (RMainLoopCallbacks c)
void assign (String sym, String[] val)
void assign (String sym, boolean[] val)
void assign (String sym, int[] val)
void assign (String sym, double[] val)
void assign (String sym, REXP r)
void assign (String sym, String ct)
REXP createRJavaRef (Object o)
void end ()
synchronized REXP eval (String s, boolean convert)
synchronized REXP eval (String s)
Mutex getRsync ()
synchronized REXP idleEval (String s, boolean convert)
synchronized REXP idleEval (String s)
boolean isStandAlone ()
void jriBusy (int which)
String jriChooseFile (int newFile)
void jriFlushConsole ()
void jriLoadHistory (String filename)
String jriReadConsole (String prompt, int addToHistory)
void jriSaveHistory (String filename)
void jriShowMessage (String message)
void jriWriteConsole (String text, int oType)
 Rengine ()
 Rengine (String[] args, boolean runMainLoop, RMainLoopCallbacks initialCallbacks)
synchronized native void rniAssign (String name, long exp, long rho)
synchronized native long rniCAR (long exp)
synchronized native long rniCDR (long exp)
long rniCons (long head, long tail)
synchronized native long rniCons (long head, long tail, long tag, boolean lang)
synchronized native long rniEval (long exp, long rho)
synchronized native int rniExpType (long exp)
synchronized native long rniFindVar (String sym, long rho)
synchronized native long rniGetAttr (long exp, String name)
synchronized native String[] rniGetAttrNames (long exp)
synchronized native int[] rniGetBoolArrayI (long exp)
synchronized native double[] rniGetDoubleArray (long exp)
synchronized native int[] rniGetIntArray (long exp)
synchronized native long[] rniGetList (long exp)
synchronized native byte[] rniGetRawArray (long exp)
synchronized native String rniGetString (long exp)
synchronized native String[] rniGetStringArray (long exp)
synchronized native String rniGetSymbolName (long sym)
synchronized native long[] rniGetVector (long exp)
synchronized native void rniIdle ()
synchronized native boolean rniInherits (long exp, String cName)
synchronized native long rniInstallSymbol (String sym)
long rniLCons (long head, long tail)
synchronized native long rniListEnv (long exp, boolean all)
synchronized native long rniParentEnv (long exp)
synchronized native long rniParse (String s, int parts)
synchronized native void rniPreserve (long exp)
synchronized native void rniPrint (String s, int oType)
synchronized native void rniPrintValue (long exp)
synchronized native void rniProtect (long exp)
synchronized native long rniPutBoolArray (boolean[] a)
synchronized native long rniPutBoolArrayI (int[] a)
synchronized native long rniPutDoubleArray (double[] a)
synchronized native long rniPutIntArray (int[] a)
synchronized native long rniPutList (long[] cont)
synchronized native long rniPutRawArray (byte[] a)
synchronized native long rniPutString (String s)
synchronized native long rniPutStringArray (String[] a)
synchronized native long rniPutVector (long[] exps)
synchronized native void rniRelease (long exp)
native int rniRJavaLock ()
native int rniRJavaUnlock ()
native void rniRunMainLoop ()
synchronized native void rniSetAttr (long exp, String name, long attr)
native int rniSetupRJava (int _in, int _out)
synchronized native long rniSpecialObject (int which)
native int rniStop (int flag)
synchronized native long rniTAG (long exp)
synchronized native void rniUnprotect (int count)
void run ()
void startMainLoop ()
synchronized boolean waitForR ()

Static Public Member Functions

static Rengine getMainEngine ()
static long getVersion ()
static boolean inMainRThread ()
static native long rniGetVersion ()
static boolean versionCheck ()

Public Attributes

int idleDelay = 200

Static Public Attributes

static int DEBUG = 0
static boolean jriLoaded
static final int SO_BaseEnv = 3
static final int SO_BlankString = 7
static final int SO_EmptyEnv = 2
static final int SO_GlobalEnv = 1
static final int SO_MissingArg = 5
static final int SO_NaString = 6
static final int SO_NilValue = 0
static final int SO_UnboundValue = 4

Package Functions

synchronized native long rniJavaToXref (Object o)
native int rniSetupR (String[] args)
synchronized native Object rniXrefToJava (long exp)
synchronized int setupR (String[] args)
synchronized int setupR ()

Static Package Functions

 [static initializer]

Package Attributes

boolean alive
String[] args
RMainLoopCallbacks callback
boolean died
boolean loopRunning
Mutex Rsync
boolean runLoop
boolean standAlone = true

Static Package Attributes

static Rengine mainEngine = null
static Thread mainRThread = null

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index