Examples of JSDecimalIntegerLiteral


Examples of org.hisrc.jscm.codemodel.literal.JSDecimalIntegerLiteral

    JSFunctionDeclaration factorial = program
        .functionDeclaration("factorial");
    // Add a function parameter
    JSVariable x = factorial.parameter("x");
    // Create an integer literal
    JSDecimalIntegerLiteral one = codeModel.integer(1);
    // Add a return statement to the function body
    factorial.getBody()._return(
        x.le(one).cond(
            one,
            x.mul(factorial.getFunctionExpression().i()
View Full Code Here

Examples of org.hisrc.jscm.codemodel.literal.JSDecimalIntegerLiteral

  }

  @Test
  public void integer() {
    JSDecimalIntegerLiteral integer = codeModel.integer(1);
    Assert.assertEquals(1, integer.asLong());
    Assert.assertEquals(1, integer.asNumber().longValue());
    Assert.assertEquals(1, integer.asDecimal().longValue());

  }
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.