예제 #1
0
파일: Lengths.java 프로젝트: graalvm/fastr
 @Override
 protected void createCasts(CastBuilder casts) {
   casts
       .arg("x")
       .defaultError(RError.SHOW_CALLER, X_LIST_ATOMIC)
       .allowNull()
       .mustBe(abstractVectorValue());
   casts
       .arg("use.names")
       .mustBe(numericValue(), RError.SHOW_CALLER, INVALID_VALUE, "use.names")
       .asLogicalVector()
       .findFirst()
       .map(toBoolean());
 }
예제 #2
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts
       .arg("x")
       .mustBe(
           numericValue().or(complexValue()),
           RError.ROOTNODE,
           RError.Message.NUMERIC_COMPLEX_MATRIX_VECTOR);
   casts
       .arg("y")
       .defaultError(RError.ROOTNODE, RError.Message.NUMERIC_COMPLEX_MATRIX_VECTOR)
       .allowNull()
       .mustBe(numericValue().or(complexValue()));
 }
예제 #3
0
 @Override
 public void createCasts(CastBuilder casts) {
   casts
       .arg("message")
       .defaultError(RError.Message.ERR_MSG_BAD)
       .mustBe(stringValue())
       .asStringVector()
       .mustBe(size(1))
       .findFirst();
 }
예제 #4
0
파일: Repeat.java 프로젝트: graalvm/fastr
 @Override
 protected void createCasts(CastBuilder casts) {
   Function<Object, Object> argType = this::argType;
   casts.arg("x").mustBe(abstractVectorValue(), RError.Message.ATTEMPT_TO_REPLICATE, argType);
   casts
       .arg("times")
       .defaultError(RError.Message.INVALID_ARGUMENT, "times")
       .mustNotBeNull()
       .asIntegerVector();
   casts
       .arg("length.out")
       .mustNotBeNull()
       .asIntegerVector()
       .shouldBe(size(1).or(size(0)), RError.Message.FIRST_ELEMENT_USED, "length.out")
       .findFirst(RRuntime.INT_NA, RError.Message.FIRST_ELEMENT_USED, "length.out")
       .mustBe(intNA().or(gte(0)));
   casts
       .arg("each")
       .asIntegerVector()
       .shouldBe(size(1).or(size(0)), RError.Message.FIRST_ELEMENT_USED, "each")
       .findFirst(1, RError.Message.FIRST_ELEMENT_USED, "each")
       .notNA(1)
       .mustBe(gte(0));
 }
예제 #5
0
파일: FormatC.java 프로젝트: graalvm/fastr
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg("x");
   casts.arg("mode").asStringVector().findFirst();
   casts.arg("width").asIntegerVector().findFirst();
   casts.arg("digits").asIntegerVector().findFirst();
   casts.arg("format").asStringVector().findFirst();
   casts.arg("flag").asStringVector().findFirst();
   casts.arg("i.strlen").asIntegerVector().findFirst();
 }
예제 #6
0
파일: Gc.java 프로젝트: graalvm/fastr
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg("verbose").asLogicalVector().findFirst().map(toBoolean());
   casts.arg("reset").asLogicalVector().findFirst().map(toBoolean());
 }
예제 #7
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg(0).allowNull().asAttributable(true, true, true);
 }
예제 #8
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg("classes").allowNull().mustBe(stringValue()).asStringVector();
   casts.arg("handlers").allowNull().mustBe(instanceOf(RList.class));
   casts.arg("calling").asLogicalVector().findFirst();
 }
예제 #9
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg("restart").asIntegerVector().findFirst();
 }
예제 #10
0
 protected void restart(CastBuilder casts) {
   casts.arg("restart").mustBe(instanceOf(RList.class), RError.Message.BAD_RESTART);
 }