Package org.hisrc.jscm.codemodel.literal

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


  }

  @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

Related Classes of org.hisrc.jscm.codemodel.literal.JSDecimalIntegerLiteral

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.