Package com.google.clearsilver.jsilver.values

Examples of com.google.clearsilver.jsilver.values.Value.asNumber()


    Value stringValue = args[0];
    Value startValue = args[1];
    Value endValue = args[2];
    String string = stringValue.asString();
    int start = startValue.asNumber();
    int end = endValue.asNumber();
    int length = string.length();

    if (start < 0) {
      start += max(-start, length);
      if (end == 0) {
View Full Code Here


public class LessFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    Value left = args[0];
    Value right = args[1];
    return literalConstant(left.asNumber() < right.asNumber(), left, right);
  }

}
View Full Code Here

public class NumericAddFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    Value left = args[0];
    Value right = args[1];
    return literalConstant(left.asNumber() + right.asNumber(), left, right);
  }

}
View Full Code Here

public class ModuloFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    Value left = args[0];
    Value right = args[1];
    return literalConstant(left.asNumber() % right.asNumber(), left, right);
  }

}
View Full Code Here

public class DivideFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    Value left = args[0];
    Value right = args[1];
    return literalConstant(left.asNumber() / right.asNumber(), left, right);
  }

}
View Full Code Here

public class SubtractFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    if (args.length == 1) {
      Value value = args[0];
      return literalConstant(0 - value.asNumber(), value);
    } else {
      Value left = args[0];
      Value right = args[1];
      return literalConstant(left.asNumber() - right.asNumber(), left, right);
    }
View Full Code Here

      Value value = args[0];
      return literalConstant(0 - value.asNumber(), value);
    } else {
      Value left = args[0];
      Value right = args[1];
      return literalConstant(left.asNumber() - right.asNumber(), left, right);
    }
  }

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