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