Esempio n. 1
0
  @Override
  public Integrator reduce(CallableBaseState state, Integrator integrator) {
    // update counts
    integrator.counts[state.getState().ordinal()]++;

    if (outputFormat == OutputFormat.STATE_PER_BASE) {
      out.println(state.toString());
    }

    // format is integrating
    if (integrator.state == null) integrator.state = state;
    else if (state.getLocation().getStart() != integrator.state.getLocation().getStop() + 1
        || integrator.state.changingState(state.getState())) {
      out.println(integrator.state.toString());
      integrator.state = state;
    } else {
      integrator.state.update(state.getLocation());
    }

    return integrator;
  }
Esempio n. 2
0
 /**
  * Get result.
  *
  * @return result
  */
 @Override
 public String getResult() {
   final List<String> result = new ArrayList<String>();
   for (final String t : value) {
     final String token = t.trim();
     // Pieces which are surrounded with braces are extension points.
     if (token.startsWith("{") && token.endsWith("}")) {
       final String extension = token.substring(1, token.length() - 1);
       final String extensionInputs = Integrator.getValue(featureTable, extension);
       if (extensionInputs != null) {
         result.add(extensionInputs);
       }
     } else {
       result.add(token);
     }
   }
   if (!result.isEmpty()) {
     return StringUtils.join(result, ",");
   } else {
     return "";
   }
 }