S-PLUS Connect/Java v1.0

com.insightful.splus
Class SplusUserApp

java.lang.Object
  extended bycom.insightful.splus.SplusUserApp
All Implemented Interfaces:
SplusEngineQueryHandler, SplusServerFileHandler

public class SplusUserApp
extends Object
implements SplusEngineQueryHandler, SplusServerFileHandler

Connects a user-written Java application to the S-PLUS engine. Provides support for querying the engine to produce SplusDataResult objects, and producing S-PLUS Java graphics.

The fields and methods for this class are static. This supports a single connection to the S-PLUS engine within a single JVM process.


Method Summary
static SplusDataResult eval(String cmd)
          Evaluate the specified S-PLUS command.
static SplusDataResult eval(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr)
          Evaluate the specified S-PLUS command.
static JComponent getGraph()
          Get the CanvasTabbedPane in which graphs will be displayed.
 FileInputStream getServerFileInputStream(String name)
          Return a FileInputStream from the JVM running the engine.
 FileOutputStream getServerFileOutputStream(String name)
          Return a FileOutputStream from the JVM running the engine.
 FileSystemView getServerFileSystemView()
          Return a FileSystemView from the JVM running the engine.
 SplusDataResult processDataQuery(String cmd)
           
 SplusDataResult processDataQuery(String cmd, int timeout)
           
 void processDialogCommand(String cmd)
           
 SplusDataResult processFileChooserDataQuery(String cmd)
           
static void startSession(String[] args)
          Start the S-PLUS Session used by the SplusUserApp with specific command-line arguments.
 void writeEngineOutput(String data, boolean prompted)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

startSession

public static void startSession(String[] args)
Start the S-PLUS Session used by the SplusUserApp with specific command-line arguments. Typically these are settings such as:

     String args[] = new String[] { 
       "java.exe",
       "S_HOME=" + System.getProperty("splus.shome"), 
       "S_PROJ=" + System.getProperty("splus.sproj")
     };
 

The first argument is the name of the application. The other arguments are typically environment variables to be set.

If the session has already been started, this method does nothing. It isn't necessary to call this method. If the method isn't used, the session will be started the first time getGraph() or eval() is called.


eval

public static SplusDataResult eval(String cmd)
Evaluate the specified S-PLUS command.

Parameters:
cmd - expression to evaluate

eval

public static SplusDataResult eval(String cmd,
                                   boolean Output,
                                   boolean Result,
                                   boolean Errors,
                                   boolean Warnings,
                                   boolean Expr)
Evaluate the specified S-PLUS command.

Parameters:
cmd - expression to evaluate
Output - true if the result should include text output, if any
Result - true if the result should include result data, if any
Errors - true if the result should include error messages, if any
Warnings - true if the result should include warning messages, if any
Expr - true if the result should include the expression (cmd)

getGraph

public static JComponent getGraph()
Get the CanvasTabbedPane in which graphs will be displayed.


getServerFileSystemView

public FileSystemView getServerFileSystemView()
Return a FileSystemView from the JVM running the engine.

Specified by:
getServerFileSystemView in interface SplusServerFileHandler

getServerFileInputStream

public FileInputStream getServerFileInputStream(String name)
                                         throws FileNotFoundException
Return a FileInputStream from the JVM running the engine.

Specified by:
getServerFileInputStream in interface SplusServerFileHandler
Throws:
FileNotFoundException

getServerFileOutputStream

public FileOutputStream getServerFileOutputStream(String name)
                                           throws FileNotFoundException,
                                                  IOException
Return a FileOutputStream from the JVM running the engine.

Specified by:
getServerFileOutputStream in interface SplusServerFileHandler
Throws:
FileNotFoundException
IOException

processDataQuery

public SplusDataResult processDataQuery(String cmd)
Specified by:
processDataQuery in interface SplusEngineQueryHandler

processFileChooserDataQuery

public SplusDataResult processFileChooserDataQuery(String cmd)

processDataQuery

public SplusDataResult processDataQuery(String cmd,
                                        int timeout)
Specified by:
processDataQuery in interface SplusEngineQueryHandler

processDialogCommand

public void processDialogCommand(String cmd)
Specified by:
processDialogCommand in interface SplusEngineQueryHandler

writeEngineOutput

public void writeEngineOutput(String data,
                              boolean prompted)
Specified by:
writeEngineOutput in interface SplusEngineQueryHandler

S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.