Examples of IntegerLiteral


Examples of au.csiro.ontology.model.IntegerLiteral

            String operatorId = datatype[1];
            String unitId = datatype[3];

            Literal value;
            if (type.equals("int")) {
                value = new IntegerLiteral(Integer.parseInt(datatype[2]));
            } else if (type.equals("float")) {
                value = new DecimalLiteral(new BigDecimal(datatype[2]));
            } else {
                log.error("Unknown type: " + type);
                return;
View Full Code Here

Examples of au.csiro.ontology.model.IntegerLiteral

                    res = new StringLiteral(literal);
                    break;
                case XSD_INTEGER:
                case XSD_NON_NEGATIVE_INTEGER:
                    if(useSimpleInts) {
                        res = new IntegerLiteral(Integer.parseInt(literal));
                    } else {
                        res = new BigIntegerLiteral(new BigInteger(literal));
                    }
                    break;
                case XSD_DATE_TIME:
View Full Code Here

Examples of au.csiro.ontology.model.IntegerLiteral

            String operatorId = datatype[1];
            String unitId = datatype[3];

            Literal value;
            if (type.equals("int")) {
                value = new IntegerLiteral(Integer.parseInt(datatype[2]));
            } else if (type.equals("float")) {
                value = new DecimalLiteral(new BigDecimal(datatype[2]));
            } else {
                log.error("Unknown type: " + type);
                return;
View Full Code Here

Examples of au.csiro.snorocket.core.model.IntegerLiteral

        if(l instanceof au.csiro.ontology.model.DateLiteral) {
            return new DateLiteral(((au.csiro.ontology.model.DateLiteral) l).getValue());
        } else if(l instanceof au.csiro.ontology.model.DecimalLiteral) {
            return new DecimalLiteral(((au.csiro.ontology.model.DecimalLiteral) l).getValue());
        } else if(l instanceof au.csiro.ontology.model.IntegerLiteral) {
            return new IntegerLiteral(((au.csiro.ontology.model.IntegerLiteral) l).getValue());
        } else if(l instanceof au.csiro.ontology.model.StringLiteral) {
            return new StringLiteral(((au.csiro.ontology.model.StringLiteral) l).getValue());
        } else if(l instanceof au.csiro.ontology.model.FloatLiteral) {
            return new DecimalLiteral(new BigDecimal(((au.csiro.ontology.model.FloatLiteral) l).getValue()));
        } else {
View Full Code Here

Examples of com.google.caja.parser.js.IntegerLiteral

  public final void testNegatedNegativeNumericConstants() {
    assertRendered(
        "- (-3)"// not --3
        Operation.create(
            FilePosition.UNKNOWN, Operator.NEGATION,
            new IntegerLiteral(FilePosition.UNKNOWN,-3)));
  }
View Full Code Here

Examples of com.google.caja.parser.js.IntegerLiteral

  public final void testNegatedNegativeNumericConstants() {
    assertRendered(
        "-(-3)"// not --3
        Operation.create(
            FilePosition.UNKNOWN, Operator.NEGATION,
            new IntegerLiteral(FilePosition.UNKNOWN,-3)));
  }
View Full Code Here

Examples of com.google.caja.parser.js.IntegerLiteral

    //   12;
    // }

    ExpressionStmt[] b = new ExpressionStmt[13];
    for (int i = b.length; --i >= 0;) {
      b[i] = new ExpressionStmt(unk, new IntegerLiteral(unk, i));
    }

    LabeledStmtWrapper b1 = new LabeledStmtWrapper(
        unk, "$1", new Block(unk, Arrays.asList(b[2], b[3], b[4])));
View Full Code Here

Examples of com.google.caja.parser.js.IntegerLiteral

  // setComments causes a warning about generic array for varargs
  public final void testImmutability() throws Exception {
    Block n = new Block(
        FilePosition.UNKNOWN,
        Arrays.asList(
            new ExpressionStmt(new IntegerLiteral(FilePosition.UNKNOWN, 42)),
            new ExpressionStmt(new IntegerLiteral(FilePosition.UNKNOWN, 13))));
    assertTrue(n.makeImmutable());
    assertTrue(n.isImmutable());
    assertTrue(n.children().get(0).isImmutable());
    assertTrue(n.children().get(0).children().get(0).isImmutable());
    assertTrue(n.children().get(1).isImmutable());
View Full Code Here

Examples of com.google.caja.parser.js.IntegerLiteral

  public final void testIncompleteImmutability() throws Exception {
    // Immutability should be best-effort, stopping at a node that refuses
    Block n = new Block(
        FilePosition.UNKNOWN,
        Arrays.asList(
            new ExpressionStmt(new IntegerLiteral(FilePosition.UNKNOWN, 42)),
            new ExpressionStmt(new AlwaysMutable())));
    assertFalse(n.makeImmutable());
    assertFalse(n.isImmutable());
    assertTrue(n.children().get(0).isImmutable());
    assertTrue(n.children().get(0).children().get(0).isImmutable());
View Full Code Here

Examples of com.google.caja.parser.js.IntegerLiteral

        "({ '@k*': @v*, baz: @boo })",
        "k", new ParseTreeNodeContainer(Arrays.asList(
            jsExpr(fromString("'foo'")), jsExpr(fromString("'bar'")))),
        "v", new ParseTreeNodeContainer(Arrays.asList(
            jsExpr(fromString("0")), jsExpr(fromString("1")))),
        "boo", new IntegerLiteral(FilePosition.UNKNOWN, 2));
    assertEquals(
        render(jsExpr(fromString("{ foo: 0, bar: 1, baz: 2 }"))),
        render(n));
  }
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.