Package org.rosuda.REngine

Examples of org.rosuda.REngine.REXPString


        return new REXPList(new RList());
      }
      else if (array[0] instanceof String)
      {
        String[] strings = ListUtils.copyStringArray(array, new String[array.length]);
        return new REXPString(strings);
      }
      else if (array[0] instanceof Number)
      {
        double[] doubles = ListUtils.copyDoubleArray(array, new double[array.length]);
        return new REXPDouble(doubles);
View Full Code Here


    }
    else if(obj instanceof double[][])  {
      return matrix2rexp((double[][])obj);
    }
    else if(obj instanceof String[]){
      return new REXPString((String[])obj);
    }
    else if(obj instanceof boolean[]){
      return new REXPLogical((boolean[])obj);
    }
    else if(obj instanceof byte[])  {
      return new REXPRaw((byte[])obj);
    }
    else if(obj instanceof Integer){
      return new REXPInteger((Integer)obj);
    }
    else if(obj instanceof Double)  {
      return new REXPDouble((Double)obj);
    }
    else if(obj instanceof String)  {
      return new REXPString((String)obj);
    }
    else if(obj instanceof Boolean)  {
      return new REXPLogical((Boolean)obj);
    }
    else if(obj instanceof Enum<?>)  {
      return new REXPString(obj.toString());
    }
    else if(obj instanceof Map<?,?>){
      return map2rexp((Map<?,?>)obj);
    }
    else if(obj instanceof List<?>)    {
      return list2rexp((List<?>)obj);
    }
    else if(cls.isArray() && !cls.getComponentType().isPrimitive()){
      return array2rexp(obj);
    }
    //else if(obj instanceof RObject)    return robject2rexp(obj);
    else if(useBean && !cls.isPrimitive() && !cls.isArray()) return bean2rexp(obj);
    else if(handleUnsupported)      return new REXPString(obj.toString());
    throw new IllegalArgumentException("Unsupported arg type " + cls);
  }
View Full Code Here

TOP

Related Classes of org.rosuda.REngine.REXPString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.