Example #1
0
 @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());
 }
Example #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()));
 }
Example #3
0
 @Override
 public void createCasts(CastBuilder casts) {
   casts
       .arg("message")
       .defaultError(RError.Message.ERR_MSG_BAD)
       .mustBe(stringValue())
       .asStringVector()
       .mustBe(size(1))
       .findFirst();
 }
Example #4
0
 @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));
 }
Example #5
0
 @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();
 }
Example #6
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg("verbose").asLogicalVector().findFirst().map(toBoolean());
   casts.arg("reset").asLogicalVector().findFirst().map(toBoolean());
 }
Example #7
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg(0).allowNull().asAttributable(true, true, true);
 }
Example #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();
 }
Example #9
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.arg("restart").asIntegerVector().findFirst();
 }
Example #10
0
 protected void restart(CastBuilder casts) {
   casts.arg("restart").mustBe(instanceOf(RList.class), RError.Message.BAD_RESTART);
 }
Example #11
0
 @Override
 protected void createCasts(CastBuilder casts) {
   casts.toInteger(1, true, false, false);
 }