本文整理汇总了Java中org.renjin.eval.EvalException类的典型用法代码示例。如果您正苦于以下问题:Java EvalException类的具体用法?Java EvalException怎么用?Java EvalException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EvalException类属于org.renjin.eval包,在下文中一共展示了EvalException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1)
throws Exception
{
if ((arg0 instanceof Vector)&&(arg1 instanceof Vector)) {
return Sequences.repeatInt(((Vector) arg0), ((Vector) arg1));
} else {
throw new EvalException(String.format("Invalid argument:\n\trep.int(%s, %s)\n\tExpected:\n\trep.int(Vector, Vector)", arg0 .getTypeName(), arg1 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$rep$int.java
示例2: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1)
throws Exception
{
if ((arg0 instanceof ListVector)&&((arg1 instanceof Vector)&&StringVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg1)))) {
return Time.asPOSIXct(((ListVector) arg0), WrapperRuntime.convertToString(arg1));
} else {
throw new EvalException(String.format("Invalid argument:\n\tas.POSIXct(%s, %s)\n\tExpected:\n\tas.POSIXct(list, character(1))", arg0 .getTypeName(), arg1 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$as$POSIXct.java
示例3: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2, SEXP arg3, SEXP arg4)
throws Exception
{
if (((((arg0 instanceof StringVector)&&(arg1 instanceof ListVector))&&(arg2 instanceof Environment))&&(arg3 instanceof SEXP))&&(arg4 instanceof LogicalVector)) {
Conditions.addConditionHandlers(context, ((StringVector) arg0), ((ListVector) arg1), ((Environment) arg2), ((SEXP) arg3), ((LogicalVector) arg4));
return Null.INSTANCE;
} else {
throw new EvalException(String.format("Invalid argument:\n\t.addCondHands(%s, %s, %s, %s, %s)\n\tExpected:\n\t.addCondHands(character, list, Environment, any, LogicalVector)", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName(), arg3 .getTypeName(), arg4 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:11,代码来源:R$primitive$$addCondHands.java
示例4: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0)
throws Exception
{
if (((arg0 instanceof IntVector)||(arg0 instanceof DoubleVector))||(arg0 instanceof LogicalVector)) {
return Types.asEnvironment(context, WrapperRuntime.convertToInt(arg0));
} else {
if (arg0 instanceof ListVector) {
return Types.asEnvironment(((ListVector) arg0));
} else {
if (arg0 instanceof Environment) {
return Types.asEnvironment(((Environment) arg0));
} else {
if (arg0 instanceof S4Object) {
return Types.asEnvironment(((S4Object) arg0));
} else {
if ((arg0 instanceof Vector)&&StringVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg0))) {
return Types.asEnvironment(context, WrapperRuntime.convertToString(arg0));
} else {
throw new EvalException(String.format("Invalid argument:\n\tas.environment(%s)\n\tExpected:\n\tas.environment(Environment)\n\tas.environment(integer(1))\n\tas.environment(character(1))\n\tas.environment(list)\n\tas.environment(S4Object)", arg0 .getTypeName()));
}
}
}
}
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:26,代码来源:R$primitive$as$environment.java
示例5: set
import org.renjin.eval.EvalException; //导入依赖的package包/类
public Builder set(Symbol name, SEXP value) {
if(CATCH_DEFINED && name.getPrintName().equals("defined")) {
throw new EvalException(value.toString());
}
if(value == Null.INSTANCE) {
return remove(name);
} else {
this.empty = false;
if(name == Symbols.CLASS) {
this.classes = (StringVector) value;
} else if(name == Symbols.NAMES) {
this.names = (StringVector) value;
} else if(name == Symbols.DIM) {
this.dim = (IntVector) value;
} else {
if(map == null) {
map = Maps.newIdentityHashMap();
}
map.put(name, value);
}
}
return this;
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:25,代码来源:AttributeMap.java
示例6: evaluateCondition
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static boolean evaluateCondition(SEXP s) {
if (s.length() == 0) {
throw new EvalException("argument is of length zero");
}
// if (s.length() > 1) {
// Warning.invokeWarning(context, call, "the condition has length > 1 and only the first element will be used");
// }
Logical logical = s.asLogical();
if (logical == Logical.NA) {
throw new EvalException("missing value where TRUE/FALSE needed");
}
return logical == Logical.TRUE;
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:17,代码来源:CompiledRuntime.java
示例7: testRenjinRemoveX
import org.renjin.eval.EvalException; //导入依赖的package包/类
@Test(expected=EvalException.class)
public void testRenjinRemoveX()
throws ScriptException, EvalException {
// Create ScriptEngine instance.
ScriptEngine rEngine = Renjin.scriptEngine();
assertNotNull(rEngine);
// Create x in workspace.
Object xorig = rEngine.eval("x <- 1");
assertNotNull(xorig);
// Retrieve x from workspace.
Object xretrieved = rEngine.eval("x");
assertNotNull(xretrieved);
// Remove x from workspace.
Object rmx = rEngine.eval("rm(x)");
assert(rmx instanceof org.renjin.sexp.Null);
// List objects in workspace.
Object ls = rEngine.eval("ls()");
assert(ls instanceof org.renjin.sexp.StringArrayVector);
// Attempt to retrieve X from workspace,
// should raise an EvalException.
Object nox = rEngine.eval("x");
}
开发者ID:onetapbeyond,项目名称:renjin-r-executor,代码行数:29,代码来源:RenjinScriptEngineTests.java
示例8: testRenjinRemoveAll
import org.renjin.eval.EvalException; //导入依赖的package包/类
@Test(expected=EvalException.class)
public void testRenjinRemoveAll()
throws ScriptException, EvalException {
// Create ScriptEngine instance.
ScriptEngine rEngine = Renjin.scriptEngine();
assertNotNull(rEngine);
// Create x in workspace.
Object xorig = rEngine.eval("x <- 1");
assertNotNull(xorig);
// Retrieve x from workspace.
Object xretrieved = rEngine.eval("x");
assertNotNull(xretrieved);
// Remove all objects from workspace.
Object rmall = rEngine.eval("rm(list = ls())");
// List objects in workspace.
Object ls = rEngine.eval("ls()");
assert(ls instanceof org.renjin.sexp.StringArrayVector);
// Attempt to retrieve X from workspace,
// should raise an EvalException.
Object nox = rEngine.eval("x");
}
开发者ID:onetapbeyond,项目名称:renjin-r-executor,代码行数:28,代码来源:RenjinScriptEngineTests.java
示例9: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2, SEXP arg3, SEXP arg4)
throws Exception
{
if (((((arg0 instanceof SEXP)&&(arg1 instanceof SEXP))&&(arg2 instanceof Vector))&&(arg3 instanceof SEXP))&&(arg4 instanceof SEXP)) {
Serialization.serializeToConn(context, ((SEXP) arg0), ((SEXP) arg1), WrapperRuntime.convertToBooleanPrimitive(arg2), ((SEXP) arg3), ((SEXP) arg4));
return Null.INSTANCE;
} else {
throw new EvalException(String.format("Invalid argument:\n\tserializeToConn(%s, %s, %s, %s, %s)\n\tExpected:\n\tserializeToConn(any, any, logical(1), any, any)", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName(), arg3 .getTypeName(), arg4 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:11,代码来源:R$primitive$serializeToConn.java
示例10: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2)
throws Exception
{
if (((arg0 instanceof SEXP)&&(arg1 instanceof SEXP))&&(arg2 instanceof SEXP)) {
return Evaluation.eval(context, ((SEXP) arg0), ((SEXP) arg1), ((SEXP) arg2));
} else {
throw new EvalException(String.format("Invalid argument:\n\teval(%s, %s, %s)\n\tExpected:\n\teval(any, any, any)", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$eval.java
示例11: open
import org.renjin.eval.EvalException; //导入依赖的package包/类
@Override
public void open(OpenSpec spec) throws IOException {
this.openSpec = spec;
if(spec.forWriting()) {
throw new EvalException("Cannot open url connection for writing");
} else {
if(spec.isText()) {
getReader();
} else {
getInputStream();
}
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:14,代码来源:UrlConnection.java
示例12: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0)
throws Exception
{
if (arg0 instanceof SEXP) {
return WrapperRuntime.wrapResult(Types.isComplex(((SEXP) arg0)));
} else {
throw new EvalException(String.format("Invalid argument:\n\tis.complex(%s)\n\tExpected:\n\tis.complex(any)", arg0 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$is$complex.java
示例13: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0)
throws Exception
{
if ((arg0 .length() == 0)||((arg0 instanceof Vector)&&StringVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg0)))) {
Vector vector1 = ((Vector) WrapperRuntime.convertToVector(arg0));
int length1 = vector1 .length();
int currentElementIndex1 = 0;
int cycles = 0;
if (length1 == 0) {
return StringVector.EMPTY;
}
if (length1 >cycles) {
cycles = length1;
}
StringVector.Builder builder = new StringVector.Builder(cycles);
for (int i = 0; (i!= cycles); i ++) {
if (vector1 .isElementNA(currentElementIndex1)) {
builder.setNA(i);
} else {
builder.set(i, Files.setwd(context, vector1 .getElementAsString(currentElementIndex1)));
}
currentElementIndex1 += 1;
if (currentElementIndex1 == length1) {
currentElementIndex1 = 0;
}
}
if (length1 == cycles) {
builder.copySomeAttributesFrom(vector1, Symbols.DIM, Symbols.DIMNAMES, Symbols.NAMES);
}
return builder.build();
} else {
throw new EvalException(String.format("Invalid argument:\n\tsetwd(%s)\n\tExpected:\n\tsetwd(character)", arg0 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:35,代码来源:R$primitive$setwd.java
示例14: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2, SEXP arg3)
throws Exception
{
if ((((arg0 instanceof Vector)&&(arg1 instanceof Vector))&&(((arg2 instanceof IntVector)||(arg2 instanceof DoubleVector))||(arg2 instanceof LogicalVector)))&&(arg3 instanceof AtomicVector)) {
return WrapperRuntime.wrapResult(Match.match(((Vector) arg0), ((Vector) arg1), WrapperRuntime.convertToInt(arg2), ((AtomicVector) arg3)));
} else {
throw new EvalException(String.format("Invalid argument:\n\tmatch(%s, %s, %s, %s)\n\tExpected:\n\tmatch(Vector, Vector, integer(1), AtomicVector)", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName(), arg3 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$match.java
示例15: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2)
throws Exception
{
if (((((arg0 instanceof IntVector)||(arg0 instanceof DoubleVector))||(arg0 instanceof LogicalVector))&&(arg1 instanceof AtomicVector))&&(arg2 instanceof AtomicVector)) {
return ComplexGroup.complex(WrapperRuntime.convertToInt(arg0), ((AtomicVector) arg1), ((AtomicVector) arg2));
} else {
throw new EvalException(String.format("Invalid argument:\n\tcomplex(%s, %s, %s)\n\tExpected:\n\tcomplex(integer(1), AtomicVector, AtomicVector)", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$complex.java
示例16: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0)
throws Exception
{
if ((arg0 .length() == 0)||((arg0 instanceof Vector)&&DoubleVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg0)))) {
Vector vector0 = ((Vector) WrapperRuntime.convertToVector(arg0));
int length0 = vector0 .length();
int currentElementIndex0 = 0;
int cycles = 0;
if (length0 == 0) {
return DoubleVector.EMPTY;
}
if (length0 >cycles) {
cycles = length0;
}
if ((cycles > 100)||(vector0 instanceof DeferredComputation)) {
return new R$primitive$round$deferred_d(vector0, vector0 .getAttributes().copyStructural());
}
org.renjin.sexp.DoubleArrayVector.Builder builder = new org.renjin.sexp.DoubleArrayVector.Builder(cycles);
for (int i = 0; (i!= cycles); i ++) {
if (vector0 .isElementNA(currentElementIndex0)) {
builder.setNA(i);
} else {
builder.set(i, MathExt.round(vector0 .getElementAsDouble(currentElementIndex0)));
}
currentElementIndex0 += 1;
if (currentElementIndex0 == length0) {
currentElementIndex0 = 0;
}
}
if (length0 == cycles) {
builder.copySomeAttributesFrom(vector0, Symbols.DIM, Symbols.DIMNAMES, Symbols.NAMES);
}
return builder.build();
} else {
throw new EvalException(String.format("Invalid argument:\n\tround(%s)\n\tExpected:\n\tround(double)\n\tround(double, integer)", arg0 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:38,代码来源:R$primitive$round.java
示例17: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1)
throws Exception
{
if (((arg0 instanceof Vector)&&StringVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg0)))&&((arg1 instanceof Vector)&&DoubleVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg1)))) {
return Connections.socketConnection(context, WrapperRuntime.convertToString(arg0), WrapperRuntime.convertToDoublePrimitive(arg1));
} else {
throw new EvalException(String.format("Invalid argument:\n\tsocketConnection(%s, %s)\n\tExpected:\n\tsocketConnection(character(1), double(1))", arg0 .getTypeName(), arg1 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$socketConnection.java
示例18: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1)
throws Exception
{
if ((arg0 instanceof SEXP)&&(arg1 instanceof Symbol)) {
return Subsetting.getSlotValue(context, context.getSingleton(MethodDispatch.class), ((SEXP) arg0), ((Symbol) arg1));
} else {
throw new EvalException(String.format("Invalid argument:\n\[email protected](%s, %s)\n\tExpected:\n\[email protected](any, Symbol)", arg0 .getTypeName(), arg1 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$$at.java
示例19: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0)
throws Exception
{
if ((arg0 .length() == 0)||((arg0 instanceof Vector)&&DoubleVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg0)))) {
Vector vector0 = ((Vector) WrapperRuntime.convertToVector(arg0));
int length0 = vector0 .length();
int currentElementIndex0 = 0;
int cycles = 0;
if (length0 == 0) {
return DoubleVector.EMPTY;
}
if (length0 >cycles) {
cycles = length0;
}
if ((cycles > 100)||(vector0 instanceof DeferredComputation)) {
return new R$primitive$log2$deferred_d(vector0, vector0 .getAttributes().copyStructural());
}
org.renjin.sexp.DoubleArrayVector.Builder builder = new org.renjin.sexp.DoubleArrayVector.Builder(cycles);
for (int i = 0; (i!= cycles); i ++) {
if (vector0 .isElementNA(currentElementIndex0)) {
builder.setNA(i);
} else {
builder.set(i, MathExt.log2(vector0 .getElementAsDouble(currentElementIndex0)));
}
currentElementIndex0 += 1;
if (currentElementIndex0 == length0) {
currentElementIndex0 = 0;
}
}
if (length0 == cycles) {
builder.copySomeAttributesFrom(vector0, Symbols.DIM, Symbols.DIMNAMES, Symbols.NAMES);
}
return builder.build();
} else {
throw new EvalException(String.format("Invalid argument:\n\tlog2(%s)\n\tExpected:\n\tlog2(double)", arg0 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:38,代码来源:R$primitive$log2.java
示例20: doApply
import org.renjin.eval.EvalException; //导入依赖的package包/类
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2, SEXP arg3)
throws Exception
{
if ((((arg0 instanceof AtomicVector)&&(((arg1 instanceof IntVector)||(arg1 instanceof DoubleVector))||(arg1 instanceof LogicalVector)))&&(((arg2 instanceof IntVector)||(arg2 instanceof DoubleVector))||(arg2 instanceof LogicalVector)))&&(arg3 instanceof Vector)) {
return Matrices.colSums(((AtomicVector) arg0), WrapperRuntime.convertToInt(arg1), WrapperRuntime.convertToInt(arg2), WrapperRuntime.convertToBooleanPrimitive(arg3));
} else {
throw new EvalException(String.format("Invalid argument:\n\tcolSums(%s, %s, %s, %s)\n\tExpected:\n\tcolSums(AtomicVector, integer(1), integer(1), logical(1))", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName(), arg3 .getTypeName()));
}
}
开发者ID:bedatadriven,项目名称:renjin-statet,代码行数:10,代码来源:R$primitive$colSums.java
注:本文中的org.renjin.eval.EvalException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论