Examples of integerValue()


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

  @Override protected SoyData visitLessThanOpNode(LessThanOpNode node) {

    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());
    }
  }
View Full Code Here

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

  @Override protected SoyData visitGreaterThanOpNode(GreaterThanOpNode node) {

    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());
    }
  }
View Full Code Here

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

  @Override protected SoyData visitLessThanOrEqualOpNode(LessThanOrEqualOpNode node) {

    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());
    }
  }
View Full Code Here

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

  @Override protected SoyData visitGreaterThanOrEqualOpNode(GreaterThanOrEqualOpNode node) {

    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());
    }
  }
View Full Code Here

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

  @Override public SoyData compute(List<SoyData> args) {
    SoyData arg0 = args.get(0);
    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()));
    }
  }
View Full Code Here

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

    SoyData value = args.get(0);
    int numDigitsAfterPt = (args.size() == 2) ? args.get(1).integerValue() : 0 /* default */;

    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();
View Full Code Here

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


  @Override public SoyData compute(List<SoyData> args) {
    SoyData arg = args.get(0);

    return toSoyData((int) Math.floor(Math.random() * arg.integerValue()));
  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {
    JsExpr arg = args.get(0);
View Full Code Here

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

  @Override public SoyData compute(List<SoyData> args) {
    SoyData arg0 = args.get(0);
    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()));
    }
  }
View Full Code Here

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

  public int getInteger(String keyStr) {
    SoyData valueData = get(keyStr);
    if (valueData == null) {
      throw new IllegalArgumentException("Missing key: " + keyStr);
    }
    return valueData.integerValue();
  }

  /**
   * Precondition: The specified key string is the path to a float.
   * Gets the float at the specified key string.
View Full Code Here

Examples of org.apache.isis.core.progmodel.facets.value.integer.IntegerValueFacet.integerValue()

    public static double doubleValue(final ObjectAssociation field, final ObjectAdapter value) {
        final ObjectSpecification specification = value.getSpecification();

        final IntegerValueFacet intValueFacet = specification.getFacet(IntegerValueFacet.class);
        if (intValueFacet != null) {
            return intValueFacet.integerValue(value).doubleValue();
        }

        final DoubleFloatingPointValueFacet doubleValueFacet = specification.getFacet(DoubleFloatingPointValueFacet.class);
        if (doubleValueFacet != null) {
            return doubleValueFacet.doubleValue(value).doubleValue();
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.