Append the new mapping

@param formatString
@param mapping
@param beginIndex
@param currentIndex
@param resultString
@return
336281
private static String mapSubformat(String formatString, Map<String, String> mapping, int beginIndex,
			int currentIndex, String escapeStart, String escapeEnd, String targetEscapeStart, String targetEscapeEnd) {
		String subformat = formatString.substring(beginIndex, currentIndex);
		if (subformat.equals(escapeStart) || subformat.equals(escapeEnd)) {
			return targetEscapeStart + "(error: cannot ecape escape characters)" + targetEscapeEnd;
		}
		if (mapping.containsKey(subformat)) {
			String result = mapping.get(subformat);
			if (result==null || result.length()==0) {
				return targetEscapeStart + "(error: " + subformat + " cannot be converted)" + targetEscapeEnd;
			}
			return result;
		}
		return subformat;
	}
74210
function formatArray(formatStr, args) {
    if (!formatStr) {
        return formatStr;
    }
    if (!args) {
        args = [];
    }
    return formatStr.replace(/{(\d+)(\:)?([^}]*)}/g, function (match, index, formatSeparator, formatExpr) {
        var resultValue = args[index];
        if (resultValue === undefined) {
            return match;
        }
        var funcDepth = 0;
        while (typeof resultValue === "function") {
            resultValue = resultValue(index, args, match, formatExpr, funcDepth++);
        }
        if (formatSeparator === ':') {
            // use format providers
            for (var i = 0; i < _formatProviders.length; i++) {
                var fp = _formatProviders[i];
                var fpCtx = new FormatProviderContext(formatExpr, resultValue);
                var fpResult;
                try {
                    fpResult = fp(fpCtx);
                }
                catch (e) {
                    continue;
                }
                if (fpCtx.handled) {
                    // handled: first wins
                    resultValue = fpResult;
                    break;
                }
            }
        }
        if (resultValue !== undefined) {
            return resultValue;
        }
        // not defined => return whole match string
        return match;
    });
}
730894
private static void appendResult(int result, Appendable dest,
            int cpLength, int options, Edits edits) throws IOException {
        // Decode the result.
        if (result < 0) {
            // (not) original code point
            if (edits != null) {
                edits.addUnchanged(cpLength);
                if ((options & OMIT_UNCHANGED_TEXT) != 0) {
                    return;
                }
            }
            appendCodePoint(dest, ~result);
        } else if (result <= UCaseProps.MAX_STRING_LENGTH) {
            // The mapping has already been appended to result.
            if (edits != null) {
                edits.addReplace(cpLength, result);
            }
        } else {
            // Append the single-code point mapping.
            int length = appendCodePoint(dest, result);
            if (edits != null) {
                edits.addReplace(cpLength, length);
            }
        }
    }
1051087
@Override
    public void addMapping(IMapping mapping) {
        if (mappingCount + 1 >= map.length) growMappingArray();
        map[mappingCount] = mapping;
        mappingCount++;
        notifyChanged();
    }
313145
public Appendable append(StringValue csq, int start, int end) {
		final int otherLen = end - start;
		grow(this.len + otherLen);
		System.arraycopy(csq.value, start, this.value, this.len, otherLen);
		this.len += otherLen;
		return this;
	}
575239
public void addTo(@Nonnull Map<String, String> attributeMap, @Nonnull Result result) {
		attributeMap.put(name, get(result));
	}
1129743
static public Map<String, ColumnMetaData> createMapByLabelOrName(ResultSetMetaData m) throws SQLException{
		Map<String, ColumnMetaData> result = new HashMap<String, ColumnMetaData>();
		for (int i = 1; i <= m.getColumnCount(); i ++){
			ColumnMetaData cm = new ColumnMetaData(m, i);
			result.put(cm.getLabelOrName(), cm);
		}
		return result;
	}
291028
private static Map<String, String> createParameterMap(String queryString) {
        if ((queryString == null) || queryString.isEmpty()) {
            return null;
        }

        final String[] pairs = queryString.split("&");
        final Map<String, String> params = new LinkedHashMap<>(pairs.length);

        for (final String pair : pairs) {
            if (pair.isEmpty()) {
                continue;
            }

            String[] tokens = pair.split("=", 2);
            switch (tokens.length) {
                case 1:
                    if (pair.charAt(0) == '=') {
                        params.put("", tokens[0]);
                    } else {
                        params.put(tokens[0], "");
                    }
                    break;
                case 2:
                    params.put(tokens[0], tokens[1]);
                    break;
            }
        }
        return new LinkedHashMap<>(params);
    }
556670
public final void addStrings(Collection<String> strCollection)
    {
        if (sourceNode != null)
        {
            String previousString = "";

            //Add all the Strings in strCollection to the MDAG.
            for (String currentString : strCollection)
            {
                int mpsIndex = calculateMinimizationProcessingStartIndex(previousString, currentString);

                //If the _transition path of the previousString needs to be examined for minimization or
                //equivalence class representation after a certain point, call replaceOrRegister to do so.
                if (mpsIndex != -1)
                {

                    String transitionSubstring = previousString.substring(0, mpsIndex);
                    String minimizationProcessingSubString = previousString.substring(mpsIndex);
                    replaceOrRegister(sourceNode.transition(transitionSubstring), minimizationProcessingSubString);
                }
                /////

                addStringInternal(currentString);
                previousString = currentString;
            }
            /////

            //Since we delay the minimization of the previously-added String
            //until after we read the next one, we need to have a seperate
            //statement to minimize the absolute last String.
            replaceOrRegister(sourceNode, previousString);
        }
        else
        {
            unSimplify();
            addStrings(strCollection);
        }
    }
1039787
static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) {
        final String baseUrl = url.toString();
        if( params == null || params.isEmpty() )
            return baseUrl;

        final StringBuilder result = new StringBuilder(baseUrl);

        addPathSeparator(baseUrl, result);
        addParamPrefix(baseUrl, result);

        Entry<?, ?> entry;
        Object value;
        Iterator<?> iterator = params.entrySet().iterator();
        entry = (Entry<?, ?>) iterator.next();
        result.append(entry.getKey().toString());
        result.append('=');
        value = entry.getValue();
        if( value != null )
            result.append(value);

        while( iterator.hasNext() ) {
            result.append('&');
            entry = (Entry<?, ?>) iterator.next();
            result.append(entry.getKey().toString());
            result.append('=');
            value = entry.getValue();
            if( value != null )
                result.append(value);
        }

        return result.toString();
    }
1068580
function(formatString, value) {

                var fieldDelimiterIndex;
                var fieldDelimiter = '{';
                var endPlaceholder = false;
                var formattedStringArray = [];

                while ((fieldDelimiterIndex = formatString.indexOf(fieldDelimiter)) !== -1) {

                    var pieceFormatedString, formatSpec, fieldName;

                    pieceFormatedString = formatString.slice(0, fieldDelimiterIndex);

                    if (endPlaceholder) {
                        formatSpec = pieceFormatedString.split(':');
                        fieldName = formatSpec.shift().split('.');
                        pieceFormatedString = value;

                        for (var i = 0; i < fieldName.length; i++)
                            pieceFormatedString = pieceFormatedString[fieldName[i]];

                        if (formatSpec.length)
                            pieceFormatedString = this.number(formatSpec, pieceFormatedString);
                    }

                    formattedStringArray.push(pieceFormatedString);

                    formatString = formatString.slice(fieldDelimiterIndex + 1);
                    endPlaceholder = !endPlaceholder;
                    fieldDelimiter = (endPlaceholder) ? '}' : '{';
                }
                formattedStringArray.push(formatString);

                return formattedStringArray.join('');
            }
367782
static void appendValues(final ResultRow rs,
                             final Appender ap,
                             final Charset charset,
                             final Formatting fmt,
                             final Iterator<ColumnType> cols, 
                             final int colIndex) {

        if (!cols.hasNext()) {
            return;
        } // end of if

        // ---

        if (colIndex > 0) {
            ap.append(fmt.valueSeparator);
        } // end of if

        final ColumnType col = cols.next();

        if (rs.isNull(colIndex)) {
            appendNull(ap, fmt, col);
            appendValues(rs, ap, charset, fmt, cols, colIndex+1);

            return;
        } // end of if

        // ---

        switch (col) {
        case BigDecimal:
            ap.append(String.format(fmt.someBigDecimal, 
                                    rs.getBigDecimal(colIndex)));
            
            break;

        case Boolean:
            ap.append(String.format(fmt.someBoolean, 
                                    rs.getBoolean(colIndex)));
            break;

        case Byte:
            ap.append(String.format(fmt.someByte, 
                                    rs.getByte(colIndex)));
            break;

        case Short:
            ap.append(String.format(fmt.someShort, 
                                    rs.getShort(colIndex)));
            break;

        case Date:
            ap.append(String.format(fmt.someDate, 
                                    rs.getDate(colIndex).getTime()));
            break;

        case Double:
            ap.append(String.format(fmt.someDouble, 
                                    rs.getDouble(colIndex)));
            break;

        case Float:
            ap.append(String.format(fmt.someFloat, 
                                    rs.getFloat(colIndex)));
            break;

        case Int:
            ap.append(String.format(fmt.someInt, 
                                    rs.getInt(colIndex)));
            break;

        case Long:
            ap.append(String.format(fmt.someLong, 
                                    rs.getLong(colIndex)));
            break;

        case Time:
            ap.append(String.format(fmt.someTime, 
                                    rs.getTime(colIndex).getTime()));
            break;

        case Timestamp:
            ap.append(String.format(fmt.someTimestamp, 
                                    rs.getTimestamp(colIndex).getTime()));
            break;

        default:
            ap.append(String.format(fmt.someString, 
                                    new String(rs.getString(colIndex).
                                               getBytes(charset)).
                                    replaceAll("\"", "\\\"")));
            break;
        } // end of switch

        appendValues(rs, ap, charset, fmt, cols, colIndex+1);
    }
609456
public static String getIndexedFormat(int index, String format) {
		if (index < 1)
			throw new IllegalArgumentException();
		if (format == null)
			throw new NullPointerException();
		if (format.length() == 0)
			throw new IllegalArgumentException();
		return String.format(INDEXED_FORMAT, index, format);
	}
420660
public StringBuilder appendTo(StringBuilder builder, Map<?, ? extends Collection<?>> map) {
		return appendTo(builder, map.entrySet());
	}
101684
public FormattedStringBuilder append(String ... strings) {
        for(String s: strings) {
            _delegate.append(s);
        }
        return this;
    }
643181
@SuppressWarnings("unchecked")
  public static Map<String, String> toStringMap(Object map) {
    if (map == null) {
      return null;
    }

    if (map instanceof Map) {
      Map<Object, Object> rawMap = (Map<Object, Object>) map;
      Map<String, String> stringMap = new HashMap<>();
      for (Entry<Object, Object> entry : rawMap.entrySet()) {
        stringMap.put(entry.getKey().toString(), entry.getValue().toString());
      }
      return stringMap;
    } else {
      throw new AvroRuntimeException("value must be a map");
    }
  }
1245593
public static QueryTemplate append(QueryTemplate queryTemplate,
                                     Iterable<String> values,
                                     CollectionFormat collectionFormat) {
    List<String> queryValues = new ArrayList<>(queryTemplate.getValues());
    queryValues.addAll(StreamSupport.stream(values.spliterator(), false)
        .filter(Util::isNotBlank)
        .collect(Collectors.toList()));
    return create(queryTemplate.getName(), queryValues, queryTemplate.getCharset(),
        collectionFormat);
  }