org.scilab.modules.types
Class ScilabVariables

java.lang.Object
  extended by org.scilab.modules.types.ScilabVariables

public final class ScilabVariables
extends java.lang.Object

Class to handle the Scilab data retrievment and conversion to a ScilabType object. All the functions sendFoo are used from C++ and should not be used on the Java side. An handler which implements ScilabVariablesHandler must be used to achieve the retrievment. The id returned by addScilabVariablesHandler must be passed from C/C++ to functions in the class org_modules_types::ScilabToJava to guarantee that the correct handler would receive its datas.


Constructor Summary
ScilabVariables()
           
 
Method Summary
static int addScilabVariablesHandler(ScilabVariablesHandler handler)
          Register a new handler
static void closeList(int[] indexes, int handlerId)
          Call when the list filling is finished a * @param indexes an integer array with the indexes of the (sub)*-list which will contain the data
static void removeScilabVariablesHandler(int id)
          Unregister an handler with a given id (the id must be considered as lost !!)
static void removeScilabVariablesHandler(ScilabVariablesHandler handler)
          Unregister an handler (the id must be considered as lost !!)
static void sendBooleanDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.IntBuffer data, int rows, int cols, int handlerId)
          Send boolean matrix as reference
static void sendData(java.lang.String varName, int[] indexes, boolean[][] data, boolean swaped, int handlerId)
          Send boolean matrix
static void sendData(java.lang.String varName, int[] indexes, byte[][] data, boolean swaped, int handlerId)
          Send int8 matrix
static void sendData(java.lang.String varName, int[] indexes, double[][] data, boolean swaped, int handlerId)
          Send double matrix
static void sendData(java.lang.String varName, int[] indexes, double[][] real, double[][] img, boolean swaped, int handlerId)
          Send complex matrix
static void sendData(java.lang.String varName, int[] indexes, int[][] data, boolean swaped, int handlerId)
          Send int32 matrix
static void sendData(java.lang.String varName, int[] indexes, int row, int col, int nbItem, int[] nbItemRow, int[] colPos, double[] real, double[] imag, int handlerId)
          Send complex sparse matrix
static void sendData(java.lang.String varName, int[] indexes, int row, int col, int nbItem, int[] nbItemRow, int[] colPos, double[] data, int handlerId)
          Send double sparse matrix
static void sendData(java.lang.String varName, int[] indexes, long[][] data, boolean swaped, int handlerId)
          Send int64 or uint64 matrix
static void sendData(java.lang.String varName, int[] indexes, short[][] data, boolean swaped, int handlerId)
          Send int16 matrix
static void sendData(java.lang.String varName, int[] indexes, java.lang.String[][] data, boolean swaped, int handlerId)
          Send string matrix
static void sendData(java.lang.String varName, int nbItems, int[] indexes, char type, int handlerId)
          Send list, tlist and mlist
static void sendDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.ByteBuffer data, int rows, int cols, int handlerId)
          Send int8 matrix as ByteBuffer
static void sendDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.DoubleBuffer real, java.nio.DoubleBuffer imag, int rows, int cols, int handlerId)
          Send complex matrix as DoubleBuffer
static void sendDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.DoubleBuffer data, int rows, int cols, int handlerId)
          Send double matrix as DoubleBuffer
static void sendDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.IntBuffer data, int rows, int cols, int handlerId)
          Send int32 matrix as IntBuffer
static void sendDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.LongBuffer data, int rows, int cols, int handlerId)
          Send int64 or uint64 matrix as LongBuffer
static void sendDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.ShortBuffer data, int rows, int cols, int handlerId)
          Send int16 matrix as ShortBuffer
static void sendPolynomial(java.lang.String varName, int[] indexes, java.lang.String polyVarName, double[][][] data, boolean swaped, int handlerId)
          Send double polynomial matrix
static void sendPolynomial(java.lang.String varName, int[] indexes, java.lang.String polyVarName, double[][][] real, double[][][] img, boolean swaped, int handlerId)
          Send complex polynomial matrix
static void sendUnsignedData(java.lang.String varName, int[] indexes, byte[][] data, boolean swaped, int handlerId)
          Send uint8 matrix
static void sendUnsignedData(java.lang.String varName, int[] indexes, int[][] data, boolean swaped, int handlerId)
          Send uint32 matrix
static void sendUnsignedData(java.lang.String varName, int[] indexes, short[][] data, boolean swaped, int handlerId)
          Send uint16 matrix
static void sendUnsignedDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.ByteBuffer data, int rows, int cols, int handlerId)
          Send uint8 matrix as ByteBuffer
static void sendUnsignedDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.IntBuffer data, int rows, int cols, int handlerId)
          Send uint32 matrix as IntBuffer
static void sendUnsignedDataAsBuffer(java.lang.String varName, int[] indexes, java.nio.ShortBuffer data, int rows, int cols, int handlerId)
          Send uint16 matrix as ShortBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScilabVariables

public ScilabVariables()
Method Detail

addScilabVariablesHandler

public static final int addScilabVariablesHandler(ScilabVariablesHandler handler)
Register a new handler

Parameters:
handler - the handler
Returns:
the id to use from C/C++

removeScilabVariablesHandler

public static final void removeScilabVariablesHandler(ScilabVariablesHandler handler)
Unregister an handler (the id must be considered as lost !!)

Parameters:
handler - the handler to remove

removeScilabVariablesHandler

public static final void removeScilabVariablesHandler(int id)
Unregister an handler with a given id (the id must be considered as lost !!)

Parameters:
id - the handler id to remove

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  double[][] data,
                                  boolean swaped,
                                  int handlerId)
Send double matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendDataAsBuffer

public static final void sendDataAsBuffer(java.lang.String varName,
                                          int[] indexes,
                                          java.nio.DoubleBuffer data,
                                          int rows,
                                          int cols,
                                          int handlerId)
Send double matrix as DoubleBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  double[][] real,
                                  double[][] img,
                                  boolean swaped,
                                  int handlerId)
Send complex matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
real - the real data
img - the imaginary data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendDataAsBuffer

public static final void sendDataAsBuffer(java.lang.String varName,
                                          int[] indexes,
                                          java.nio.DoubleBuffer real,
                                          java.nio.DoubleBuffer imag,
                                          int rows,
                                          int cols,
                                          int handlerId)
Send complex matrix as DoubleBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  int[][] data,
                                  boolean swaped,
                                  int handlerId)
Send int32 matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendDataAsBuffer

public static final void sendDataAsBuffer(java.lang.String varName,
                                          int[] indexes,
                                          java.nio.IntBuffer data,
                                          int rows,
                                          int cols,
                                          int handlerId)
Send int32 matrix as IntBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendUnsignedData

public static final void sendUnsignedData(java.lang.String varName,
                                          int[] indexes,
                                          short[][] data,
                                          boolean swaped,
                                          int handlerId)
Send uint16 matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendUnsignedDataAsBuffer

public static final void sendUnsignedDataAsBuffer(java.lang.String varName,
                                                  int[] indexes,
                                                  java.nio.ShortBuffer data,
                                                  int rows,
                                                  int cols,
                                                  int handlerId)
Send uint16 matrix as ShortBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  short[][] data,
                                  boolean swaped,
                                  int handlerId)
Send int16 matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendDataAsBuffer

public static final void sendDataAsBuffer(java.lang.String varName,
                                          int[] indexes,
                                          java.nio.ShortBuffer data,
                                          int rows,
                                          int cols,
                                          int handlerId)
Send int16 matrix as ShortBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendUnsignedData

public static final void sendUnsignedData(java.lang.String varName,
                                          int[] indexes,
                                          byte[][] data,
                                          boolean swaped,
                                          int handlerId)
Send uint8 matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendUnsignedDataAsBuffer

public static final void sendUnsignedDataAsBuffer(java.lang.String varName,
                                                  int[] indexes,
                                                  java.nio.ByteBuffer data,
                                                  int rows,
                                                  int cols,
                                                  int handlerId)
Send uint8 matrix as ByteBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  boolean[][] data,
                                  boolean swaped,
                                  int handlerId)
Send boolean matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendBooleanDataAsBuffer

public static final void sendBooleanDataAsBuffer(java.lang.String varName,
                                                 int[] indexes,
                                                 java.nio.IntBuffer data,
                                                 int rows,
                                                 int cols,
                                                 int handlerId)
Send boolean matrix as reference

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  byte[][] data,
                                  boolean swaped,
                                  int handlerId)
Send int8 matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendDataAsBuffer

public static final void sendDataAsBuffer(java.lang.String varName,
                                          int[] indexes,
                                          java.nio.ByteBuffer data,
                                          int rows,
                                          int cols,
                                          int handlerId)
Send int8 matrix as ByteBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  long[][] data,
                                  boolean swaped,
                                  int handlerId)
Send int64 or uint64 matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendDataAsBuffer

public static final void sendDataAsBuffer(java.lang.String varName,
                                          int[] indexes,
                                          java.nio.LongBuffer data,
                                          int rows,
                                          int cols,
                                          int handlerId)
Send int64 or uint64 matrix as LongBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendUnsignedData

public static final void sendUnsignedData(java.lang.String varName,
                                          int[] indexes,
                                          int[][] data,
                                          boolean swaped,
                                          int handlerId)
Send uint32 matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendUnsignedDataAsBuffer

public static final void sendUnsignedDataAsBuffer(java.lang.String varName,
                                                  int[] indexes,
                                                  java.nio.IntBuffer data,
                                                  int rows,
                                                  int cols,
                                                  int handlerId)
Send uint32 matrix as IntBuffer

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  java.lang.String[][] data,
                                  boolean swaped,
                                  int handlerId)
Send string matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  int row,
                                  int col,
                                  int nbItem,
                                  int[] nbItemRow,
                                  int[] colPos,
                                  double[] data,
                                  int handlerId)
Send double sparse matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
row - the row number
col - the col number
nbItem - the number of non null elements
nbItemRow - the number by row of non null elements
colPos - the column position of the non null elements
data - the data
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int[] indexes,
                                  int row,
                                  int col,
                                  int nbItem,
                                  int[] nbItemRow,
                                  int[] colPos,
                                  double[] real,
                                  double[] imag,
                                  int handlerId)
Send complex sparse matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
row - the row number
col - the col number
nbItem - the number of non null elements
nbItemRow - the number by row of non null elements
colPos - the column position of the non null elements
real - the real data
imag - the imaginary data
handlerId - the handler id

sendPolynomial

public static final void sendPolynomial(java.lang.String varName,
                                        int[] indexes,
                                        java.lang.String polyVarName,
                                        double[][][] data,
                                        boolean swaped,
                                        int handlerId)
Send double polynomial matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
polyVarName - the polynomial variable name
data - the data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendPolynomial

public static final void sendPolynomial(java.lang.String varName,
                                        int[] indexes,
                                        java.lang.String polyVarName,
                                        double[][][] real,
                                        double[][][] img,
                                        boolean swaped,
                                        int handlerId)
Send complex polynomial matrix

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
polyVarName - the polynomial variable name
real - the real data
img - the imaginary data
swaped - true if the matrix is stored row by row
handlerId - the handler id

sendData

public static final void sendData(java.lang.String varName,
                                  int nbItems,
                                  int[] indexes,
                                  char type,
                                  int handlerId)
Send list, tlist and mlist

Parameters:
varName - the variable name
indexes - an integer array with the indexes of the (sub)*-list which will contain the data
type - a char which must take the values 'l' for list or 'm' for mlist or 't' for tlist
handlerId - the handler id

closeList

public static final void closeList(int[] indexes,
                                   int handlerId)
Call when the list filling is finished a * @param indexes an integer array with the indexes of the (sub)*-list which will contain the data

Parameters:
handlerId - the handler id