Exemplo n.º 1
0
  /**
   * Method to create data values for the formal arguments of a vocab element.
   *
   * @param tokens The array of string tokens.
   * @param startI The starting index to
   * @param destValue The destination value that we are populating.
   */
  private void parseFormalArgs(
      final String[] tokens,
      final int startI,
      final Argument destPattern,
      final MatrixValue destValue) {

    for (int i = 0; i < destValue.getArguments().size(); i++) {
      Argument fa = destPattern.childArguments.get(i);
      boolean emptyArg = false;

      // If the field doesn't contain anything or matches the FargName
      // we consider the argument to be 'empty'.
      if ((tokens[startI + i].length() == 0) || tokens[startI + i].equals(fa.name)) {
        emptyArg = true;
      }

      tokens[startI + i] = tokens[startI + i].trim();
      destValue.getArguments().get(i).set(tokens[startI + i]);
    }
  }