Examples of EvalException


Examples of org.renjin.eval.EvalException

    } else if(code_string.equalsIgnoreCase("set")) {
      code = prim_methods_t.HAS_METHODS;
    } else if(code_string.equalsIgnoreCase("suppress")) {
      code = prim_methods_t.SUPPRESSED;
    else {
      throw new EvalException("invalid primitive methods code (\"%s\"): should be \"clear\", \"reset\", \"set\", or \"suppress\"", code_string);
    }
    return code;
  }
View Full Code Here

Examples of org.renjin.eval.EvalException

    //      ptr = R_get_standardGeneric_ptr();
    //      }

 
    if(Strings.isNullOrEmpty(fname)) {
      throw new EvalException("argument to 'standardGeneric' must be a non-empty character string");
   
    SEXP fdef = get_this_generic(context, fname);
    if(fdef == Null.INSTANCE) {
      throw new EvalException("call to standardGeneric(\"%s\") apparently not from the body of that generic function", fname);
    }

    return context.getSession().getSingleton(MethodDispatch.class)
    .standardGeneric(context, Symbol.get(fname), env, fdef);
   
View Full Code Here

Examples of org.renjin.eval.EvalException

      return (Symbol) name;
    }
    if(name instanceof StringVector && name.length() == 1) {
      return Symbol.get(name.asString());
    }
    throw new EvalException("Invalid type or length for a slot name");
  }
View Full Code Here

Examples of org.renjin.eval.EvalException

          throw new UnsupportedOperationException();
        }
        input = name.getPrintName();
        classString = obj.getAttribute(Symbols.CLASS);
        if(classString == Null.INSTANCE) {
          throw new EvalException("cannot get a slot (\"%s\") from an object of type \"%s\"",
              input, obj.getTypeName());
        }

        /* not there.  But since even NULL really does get stored, this
         implies that there is no slot of this name.  Or somebody
         screwed up by using attr(..) <- NULL */

        throw new EvalException("no slot of name \"%s\" for this object of class \"%s\"",
            input, classString.asString());
      }
      else if(value == MethodDispatch.pseudo_NULL) {
        value = Null.INSTANCE;
      }
View Full Code Here

Examples of org.renjin.eval.EvalException

      }
      fun = Symbol.UNBOUND_VALUE;
    }
    fun = symbol;
    if(fun == Symbol.UNBOUND_VALUE) {
      throw new EvalException("unable to find a non-generic version of function \"%s\"",
         name);
    }
   
    Context cptr = context;
    /* check this is the right context */
 
View Full Code Here

Examples of org.renjin.eval.EvalException

  private static String getHexRgb(double red, double green, double blue,
      double alpha, double maxColorValue, boolean useAlpha) {
    if (red < 0 || green < 0 || blue < 0 || alpha < 0
        || red > maxColorValue || green > maxColorValue
        || blue > maxColorValue || alpha > maxColorValue) {
      throw new EvalException(
          "One of the color intensities is not in [0,"
              + maxColorValue + "]");
    }
    StringBuilder hex = new StringBuilder();
    hex.append('#');
View Full Code Here

Examples of org.renjin.eval.EvalException

        rgb = getColorStrFromName(name);
      } else if (s.getTypeName().equals("double")) {
        name = defaultPalette[(int) (s.getElementAsDouble(j) % defaultPalette.length)];
        rgb = getColorStrFromName(name);
      } else {
        throw new EvalException(
            "Parameter must be a color index or valid color name");
      }
      if (rgb == null) {
        throw new EvalException("Invalid color name: " + name);
      }
      result = getRGBComponentsFromCode(rgb);

      for (int i = 0; i < result.length; i++) {
        ib.add(result[i]);
View Full Code Here

Examples of org.renjin.eval.EvalException

  }

  @Override
  public void setValue(Object instance, SEXP value) {
    if(setters.size() == 0) {
      throw new EvalException("The property '%s' on class '%s' is read-only", name,
          getter.getDeclaringClass().getName());
    } else if(setters.size() > 1) {
      throw new EvalException("Overloaded setters are not yet implemented");
    }
   
    setters.get(0).setValue(instance, value);
  }
View Full Code Here

Examples of org.renjin.eval.EvalException

    return (new double[] { R, G, B });
  }

  private static int ScaleAlpha(double x) {
    if (!DoubleVector.isFinite(x) || x < 0.0 || x > 1.0)
      throw new EvalException("alpha level " + x + ", not in [0,1]");
    return (int) (255 * x + 0.5);
  }
View Full Code Here

Examples of org.renjin.eval.EvalException

        throw new RuntimeException(e);
      } catch (IllegalAccessException e) {
        // should not happen since we've already made sure the setter is public
        throw new RuntimeException(e);
      } catch (InvocationTargetException e) {
        throw new EvalException("Exception thrown while calling setter '%s' on instance of class '%s'",
            method.getName(), method.getDeclaringClass().getName());
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.