Package org.renjin.eval

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


          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

      }
      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

  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

        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

  }

  @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

    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

        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

   for(Parameter param : ParTable) {
     if(param.getName().equals(name)) {
       return param;
     }
   }
   throw new EvalException("no parameter found by name " + name);

  }
View Full Code Here

    for(Overload overload : overloads) {
      if(overload.accept(args)) {
        return overload.invoke(context, instance, args);
      }
    }
    throw new EvalException("Cannot match arguments (%s) to any JVM method overload:\n%s",
        ExceptionUtil.toString(args), ExceptionUtil.overloadListToString(overloads));
  }
View Full Code Here

TOP

Related Classes of org.renjin.eval.EvalException

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.