|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--netscape.plugin.Plugin
|
+--RNetscape
A LiveConnect class that connects an embedded R interpreter/engine acting as a Plugin for Netscape with JavaScript and other plugins, allowing JavaScript code to call S functions and evaluate S expressions and for S to evaluate JavaScript code.
| Field Summary | |
protected boolean |
debug
A flag controlling whether to display debugging information. |
static boolean |
DefaultDebug
This is the default setting for the debug flag
that each instance of RNetscape picks up when it is created. |
| Constructor Summary | |
RNetscape()
This class is never constructed via a direct call to this default constructor, but is instead instantiated in C code by the Netscape JRI directly, having obtained this class by asking the Plugin for its associated Java class. |
|
| Method Summary | |
java.lang.Object |
call(java.lang.String functionName)
This is the version of the call() function that takes no arguments, and only the name of the S function to be invoked. |
java.lang.Object |
call(java.lang.String functionName,
netscape.javascript.JSObject jsobj)
This is the method that is called from JavaScript when we wrapup a list of arguments there and invoke the call() method in the R interpreter object. |
java.lang.Object |
call(java.lang.String functionName,
netscape.javascript.JSObject arg1,
netscape.javascript.JSObject arg2)
A simple and specific version of the call method that calls an S function with two arguments, both of which are JavaScript objects (i.e. |
java.lang.Object |
call(java.lang.String functionName,
java.lang.Number arg1)
|
java.lang.Object |
call(java.lang.String functionName,
java.lang.Number arg1,
java.lang.Number arg2)
A simple and specific version of the call method that calls an S function with two arguments all of which are numbers (integers or reals). |
java.lang.Object |
call(java.lang.String functionName,
java.lang.Number arg1,
java.lang.Number arg2,
java.lang.Number arg3)
A simple and specific version of the call method that calls an S function with three arguments all of which are numbers (integers or reals). |
java.lang.Object |
call(java.lang.String functionName,
java.lang.Object args)
The generic version of the call method that determines to which of the other call methods to dispatch this invocation based on the type of the args argument. |
java.lang.Object |
call(java.lang.String functionName,
java.lang.Object[] args)
This is the heart of the mechanism by which JavaScript can invoke S functions, taking an arbitrary number of arguments in the form of an array. |
java.lang.Object |
call(java.lang.String functionName,
java.lang.Object arg1,
java.lang.Object arg2)
A simple and specific version of the call method that calls an S function with two arguments which can be of any type. |
java.lang.Object |
call(java.lang.String functionName,
java.lang.String arg1)
A simple version of the call method that calls an S function with a single argument which is a String. |
java.lang.Object |
call(java.lang.String functionName,
java.lang.String arg1,
java.lang.Boolean arg2)
A simple and specific version of the call method that calls an S function with two arguments which must be a String and a boolean. |
java.lang.Object |
call1ArgStringFunction(java.lang.String functionName,
java.lang.String arg)
This is default version of the native call1ArgString
method that provides the default value (false) for the ignore argument. |
java.lang.Object |
call1ArgStringFunction(java.lang.String functionName,
java.lang.String arg,
boolean ignore)
Native method that calls an S function with a single argument which is a string. |
protected static java.lang.Object[] |
convertArray(netscape.javascript.JSObject jsobj)
|
java.lang.Object |
eval(java.lang.String cmd)
This allows JavaScript users to evaluate an S expression that is provided in the form of a string. |
java.lang.Object |
eval(java.lang.String cmd,
int print)
Calls netscapeEval() with both arguments allowing the user to control the form of the output, i.e. |
java.lang.Object |
evalPrint(java.lang.String cmd)
This evaluates the specified S expression and traps any output generated (via the S functions cat() and print()) in a string and returns that. |
boolean |
exists(java.lang.String name)
This is the JavaScript callable version of the S exists() function. |
boolean |
get(java.lang.String name)
This retrieves the S object bound to the variable named name. |
boolean |
getDebug()
Query the current setting of the debug flag. |
netscape.javascript.JSObject |
getDummyJSObject()
This is a method used by the C code for the S-Netscape plugin when it is converting an S obejct to a JavaScript object and needs create a new JavaScript object instance. |
void |
init()
This is called by Netscape after it has created the instance of this class for a particular page/window. |
java.lang.Object |
library(java.lang.String name)
Simple access to the library function in S that allows one to specify just the name of the library to load. |
java.lang.Object |
namedArgCall(java.lang.String funcName,
netscape.javascript.JSObject obj)
Call to an S function identified by funcName
using the members of the given obj as named arguments. |
java.lang.Object |
namedArgCall(java.lang.String funcName,
netscape.javascript.JSObject argNames,
netscape.javascript.JSObject args)
Call an S function with named arguments, with the names in the first array and the corresponding values in the second array. |
java.lang.Object |
namedArgCall(java.lang.String funcName,
java.lang.Object[] argNames,
java.lang.Object[] args)
Invokes the specified S function using the named arguments identified by the parallel arrays of names and values. |
void |
remove(java.lang.String name)
This is the JavaScript-callable version of the S function remove(). |
void |
setDebug(boolean val)
Set the value of the debugging flag to control whether debugging information is displayed during the execution of the methods. |
boolean |
source(java.lang.String name)
Calls the S function source() and discards the result. |
| Methods inherited from class netscape.plugin.Plugin |
destroy,
getPeer,
getWindow,
isActive |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected boolean debug
public static boolean DefaultDebug
debug flag
that each instance of RNetscape picks up when it is created.| Constructor Detail |
public RNetscape()
| Method Detail |
public java.lang.Object eval(java.lang.String cmd)
call(java.lang.String, java.lang.Object[]) method.cmd - the S expression to be evaluated.
public java.lang.Object eval(java.lang.String cmd,
int print)
public java.lang.Object evalPrint(java.lang.String cmd)
cmd - the S expression(s) to be evaluated.public void init()
public boolean exists(java.lang.String name)
public java.lang.Object library(java.lang.String name)
name - the name of the library to loadpublic boolean source(java.lang.String name)
public void remove(java.lang.String name)
public boolean get(java.lang.String name)
public java.lang.Object call(java.lang.String functionName,
java.lang.Object[] args)
functionName - the name of the S function to be invokedargs - an array containing the arguments to the S function.public java.lang.Object call(java.lang.String functionName)
public java.lang.Object call(java.lang.String functionName,
java.lang.Object args)
functionName - the name of the S function to invoke.args -
public java.lang.Object call(java.lang.String functionName,
java.lang.String arg1)
functionName - the name of the S function to invoke.
public java.lang.Object call(java.lang.String functionName,
netscape.javascript.JSObject jsobj)
call(java.lang.String,java.lang.Object[])
public java.lang.Object call(java.lang.String functionName,
netscape.javascript.JSObject arg1,
netscape.javascript.JSObject arg2)
functionName - the name of the S function to invoke.
public java.lang.Object call(java.lang.String functionName,
java.lang.Number arg1,
java.lang.Number arg2)
functionName - the name of the S function to invoke.
public java.lang.Object call(java.lang.String functionName,
java.lang.Number arg1)
public java.lang.Object call(java.lang.String functionName,
java.lang.Number arg1,
java.lang.Number arg2,
java.lang.Number arg3)
functionName - the name of the S function to invoke.
public java.lang.Object call(java.lang.String functionName,
java.lang.String arg1,
java.lang.Boolean arg2)
functionName - the name of the S function to invoke.
public java.lang.Object call(java.lang.String functionName,
java.lang.Object arg1,
java.lang.Object arg2)
functionName - the name of the S function to invoke.
public java.lang.Object namedArgCall(java.lang.String funcName,
java.lang.Object[] argNames,
java.lang.Object[] args)
public java.lang.Object namedArgCall(java.lang.String funcName,
netscape.javascript.JSObject argNames,
netscape.javascript.JSObject args)
args = new Array(myData, "X label", "Y label");
argNames = new Array("", "xlab", "ylab");
R.namedArgCall("hist", argNames, args);
public java.lang.Object namedArgCall(java.lang.String funcName,
netscape.javascript.JSObject obj)
funcName
using the members of the given obj as named arguments.
Example:
args = new Object();
args.[0] = myData;
args.xlab = "X label";
args.ylab = "Y label";
R.namedArgCall("hist", args);public netscape.javascript.JSObject getDummyJSObject()
public java.lang.Object call1ArgStringFunction(java.lang.String functionName,
java.lang.String arg,
boolean ignore)
functionName - the name of the S function to be invokedarg - the argument to the S functionignore - indicates whether we should discard the return value or not.
public java.lang.Object call1ArgStringFunction(java.lang.String functionName,
java.lang.String arg)
call1ArgString
method that provides the default value (false) for the ignore argument.functionName - the name of the S function to be invokedarg - the argument to the S functionprotected static java.lang.Object[] convertArray(netscape.javascript.JSObject jsobj)
public boolean getDebug()
public void setDebug(boolean val)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||