Examples of numberValue()


Examples of com.google.template.soy.data.SoyData.numberValue()

    SoyData operand0 = visit(node.getChild(0));
    SoyData operand1 = visit(node.getChild(1));
    if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) {
      return convertResult(operand0.integerValue() < operand1.integerValue());
    } else {
      return convertResult(operand0.numberValue() < operand1.numberValue());
    }
  }


  @Override protected SoyData visitGreaterThanOpNode(GreaterThanOpNode node) {
View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

    SoyData operand0 = visit(node.getChild(0));
    SoyData operand1 = visit(node.getChild(1));
    if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) {
      return convertResult(operand0.integerValue() > operand1.integerValue());
    } else {
      return convertResult(operand0.numberValue() > operand1.numberValue());
    }
  }


  @Override protected SoyData visitLessThanOrEqualOpNode(LessThanOrEqualOpNode node) {
View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

    SoyData operand0 = visit(node.getChild(0));
    SoyData operand1 = visit(node.getChild(1));
    if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) {
      return convertResult(operand0.integerValue() <= operand1.integerValue());
    } else {
      return convertResult(operand0.numberValue() <= operand1.numberValue());
    }
  }


  @Override protected SoyData visitGreaterThanOrEqualOpNode(GreaterThanOrEqualOpNode node) {
View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

    SoyData operand0 = visit(node.getChild(0));
    SoyData operand1 = visit(node.getChild(1));
    if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) {
      return convertResult(operand0.integerValue() >= operand1.integerValue());
    } else {
      return convertResult(operand0.numberValue() >= operand1.numberValue());
    }
  }


  @Override protected SoyData visitEqualOpNode(EqualOpNode node) {
View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

    SoyData arg1 = args.get(1);

    if (arg0 instanceof IntegerData && arg1 instanceof IntegerData) {
      return toSoyData(Math.min(arg0.integerValue(), arg1.integerValue()));
    } else {
      return toSoyData(Math.min(arg0.numberValue(), arg1.numberValue()));
    }
  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {
View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

    if (numDigitsAfterPt == 0) {
      if (value instanceof IntegerData) {
        return toSoyData(value.integerValue());
      } else {
        return toSoyData((int) Math.round(value.numberValue()));
      }
    } else if (numDigitsAfterPt > 0) {
      double valueDouble = value.numberValue();
      double shift = Math.pow(10, numDigitsAfterPt);
      return toSoyData(Math.round(valueDouble * shift) / shift);
View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

        return toSoyData(value.integerValue());
      } else {
        return toSoyData((int) Math.round(value.numberValue()));
      }
    } else if (numDigitsAfterPt > 0) {
      double valueDouble = value.numberValue();
      double shift = Math.pow(10, numDigitsAfterPt);
      return toSoyData(Math.round(valueDouble * shift) / shift);
    } else {
      double valueDouble = value.numberValue();
      double shift = Math.pow(10, -numDigitsAfterPt);
View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

    } else if (numDigitsAfterPt > 0) {
      double valueDouble = value.numberValue();
      double shift = Math.pow(10, numDigitsAfterPt);
      return toSoyData(Math.round(valueDouble * shift) / shift);
    } else {
      double valueDouble = value.numberValue();
      double shift = Math.pow(10, -numDigitsAfterPt);
      return toSoyData((int) (Math.round(valueDouble / shift) * shift));
    }
  }

View Full Code Here

Examples of com.google.template.soy.data.SoyData.numberValue()

    SoyData arg1 = args.get(1);

    if (arg0 instanceof IntegerData && arg1 instanceof IntegerData) {
      return toSoyData(Math.max(arg0.integerValue(), arg1.integerValue()));
    } else {
      return toSoyData(Math.max(arg0.numberValue(), arg1.numberValue()));
    }
  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {
View Full Code Here

Examples of com.sun.java.util.jar.pack.ConstantPool.NumberEntry.numberValue()

                writeUtf8Bands(cpMap);
                break;
            case CONSTANT_Integer:
                for (int i = 0; i < cpMap.length; i++) {
                    NumberEntry e = (NumberEntry) cpMap[i];
                    int x = ((Integer)e.numberValue()).intValue();
                    cp_Int.putInt(x);
                }
                break;
            case CONSTANT_Float:
                for (int i = 0; i < cpMap.length; i++) {
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.