Package com.firefly.template.support.RPNUtils

Examples of com.firefly.template.support.RPNUtils.Fragment


  }

  public String parse(String content) {
    List<Fragment> list = RPNUtils.getReversePolishNotation(content);
    if (list.size() == 1) {
      Fragment f = list.get(0);
      return f.type == VARIABLE ? getVariable(f.value, "Boolean")
          : f.value;
    }
    Deque<Fragment> d = new LinkedList<Fragment>();
    for (Fragment f : list) {
      if (isSymbol(f.type)) {
        Fragment right = d.pop();
        Fragment left = d.pop();

        Fragment ret = new Fragment();
        switch (f.type) {
        case ARITHMETIC_OPERATOR:
          if (left.type == STRING || right.type == STRING) {
            ret.type = STRING;
            if (f.value.equals("+")) {
View Full Code Here


  }

  public String parse(String content) {
    List<Fragment> list = RPNUtils.getReversePolishNotation(content);
    if (list.size() == 1) {
      Fragment f = list.get(0);
      return f.type == VARIABLE ? getVariable(f.value, "Boolean") : f.value;
    }
    Deque<Fragment> d = new LinkedList<Fragment>();
    for (Fragment f : list) {
      if (isSymbol(f.type)) {
        Fragment right = d.pop();
        Fragment left = d.pop();

        Fragment ret = new Fragment();
        switch (f.type) {
        case ARITHMETIC_OPERATOR:
          if (left.type == STRING || right.type == STRING) {
            ret.type = STRING;
            if (f.value.equals("+")) {
View Full Code Here

TOP

Related Classes of com.firefly.template.support.RPNUtils.Fragment

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.