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

double [] org::rosuda::JRclient::REXP::asDoubleArray (  )  [inline]

get content of the REXP as an array of doubles. Array of integers, single double and single integer are automatically converted into such an array if necessary.

double[] content or null if the REXP is not a array of doubles or integers

Definition at line 503 of file REXP.java.

References asDouble(), asIntArray(), cont, Xt, XT_ARRAY_DOUBLE, XT_ARRAY_INT, XT_DOUBLE, and XT_INT.

Referenced by asDoubleMatrix().

        if (Xt==XT_ARRAY_DOUBLE) return (double[])cont;
        if (Xt==XT_DOUBLE) {
            double[] d=new double[1]; d[0]=asDouble(); return d;
        if (Xt==XT_INT) {
            double[] d=new double[1]; d[0]=((Integer)cont).doubleValue(); return d;
        if (Xt==XT_ARRAY_INT) {
            int[] i=asIntArray();
            if (i==null) return null;
            double[] d=new double[i.length];
            int j=0;
            while (j<i.length) {
                d[j]=(double)i[j]; j++;
            return d;
        return null;

Generated by  Doxygen 1.6.0   Back to index