Package org.renjin.sexp

Examples of org.renjin.sexp.ExternalPtr


    return new S4Object();
  }


  public static ExternalPtr R_externalptr_prototype_object() {
    return new ExternalPtr(null);
  }
View Full Code Here


    }
  }
 
  @Test
  public void publicMethodCallOnPrivateObject() {
    topLevelContext.getGlobalEnvironment().setVariable("obj", new ExternalPtr(new MyPrivateImpl()));
    eval("obj$doSomething()");
  }
View Full Code Here

  @Override
  public SEXP convertToR(Object value) {
    if(value == null) {
      return Null.INSTANCE;
    }
    return new ExternalPtr(value);
  }
View Full Code Here

  @Override
  public Object convertToJava(SEXP exp) {

    // try to simply unwrap
    if(exp instanceof ExternalPtr) {
      ExternalPtr ptr = (ExternalPtr)exp;
      if(clazz.isAssignableFrom(ptr.getInstance().getClass())) {
        return ptr.getInstance();
      }
    }
    throw new ConversionException();
  }
View Full Code Here

    if(!context.getSession().getSecurityManager().allowNewInstance(clazz)) {
      throw new EvalException("Permission to create a new instance of class '%s' has been denied by the security manager",
          className);
    }

    ExternalPtr ptr = new ExternalPtr(clazz);
    rho.setVariable(Symbol.get(clazz.getSimpleName()), ptr);
    context.setInvisibleFlag();

    return ptr;
  }
View Full Code Here

TOP

Related Classes of org.renjin.sexp.ExternalPtr

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.