Refine search
/** * <p>Gets the range as a <code>String</code>.</p> * * <p>The format of the String is 'Range[<i>min</i>,<i>max</i>]'.</p> * * @return the <code>String</code> representation of this range */ public String toString() { if (toString == null) { StrBuilder buf = new StrBuilder(32); buf.append("Range["); buf.append(min); buf.append(','); buf.append(max); buf.append(']'); toString = buf.toString(); } return toString; }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
StrBuilder arrayPrefix = new StrBuilder(); while (className.charAt(0) == '[') { className = className.substring(1); arrayPrefix.append("[]");
/** * <p>Gets the range as a <code>String</code>.</p> * * <p>The format of the String is 'Range[<i>min</i>,<i>max</i>]'.</p> * * @return the <code>String</code> representation of this range */ public String toString() { if (toString == null) { StrBuilder buf = new StrBuilder(32); buf.append("Range["); buf.append(min); buf.append(','); buf.append(max); buf.append(']'); toString = buf.toString(); } return toString; }
private String createSummaryString(int truncateLength) { StrBuilder httpString = new StrBuilder(); httpString.append(protocolVersion).append(" ").append(statusCode).append(" ").append(statusMessage); httpString.appendNewLine(); httpString.appendWithSeparators(headers, SystemUtils.LINE_SEPARATOR); if (StringUtils.isNotEmpty(content)) { httpString.appendNewLine(); httpString.appendNewLine(); httpString.append(StringUtils.abbreviate(content, truncateLength)); } return httpString.toString(); }
/** * <p>Gets the range as a <code>String</code>.</p> * * <p>The format of the String is 'Range[<i>min</i>,<i>max</i>]'.</p> * * @return the <code>String</code> representation of this range */ public String toString() { if (toString == null) { StrBuilder buf = new StrBuilder(32); buf.append("Range["); buf.append(min); buf.append(','); buf.append(max); buf.append(']'); toString = buf.toString(); } return toString; }
private String createSummaryString(int truncateLength) { StrBuilder httpString = new StrBuilder(); httpString.append(protocolVersion).append(" ").append(statusCode).append(" ").append(statusMessage); httpString.appendNewLine(); httpString.appendWithSeparators(headers, SystemUtils.LINE_SEPARATOR); if (StringUtils.isNotEmpty(content)) { httpString.appendNewLine(); httpString.appendNewLine(); httpString.append(StringUtils.abbreviate(content, truncateLength)); } return httpString.toString(); }
/** * <p>Gets the range as a <code>String</code>.</p> * * <p>The format of the String is 'Range[<i>min</i>,<i>max</i>]'.</p> * * @return the <code>String</code> representation of this range */ public String toString() { if (toString == null) { StrBuilder buf = new StrBuilder(32); buf.append("Range["); buf.append(min); buf.append(','); buf.append(max); buf.append(']'); toString = buf.toString(); } return toString; }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * <p>Returns the string representation of this range.</p> * * <p>This string is the string representation of the minimum and * maximum numbers in the range, separated by a hyphen. If a number * is negative, then it is enclosed in parentheses.</p> * * @return the string representation of this range */ public String toString() { StrBuilder sb = new StrBuilder(); if (min.doubleValue() < 0) { sb.append('(') .append(min) .append(')'); } else { sb.append(min); } sb.append('-'); if (max.doubleValue() < 0) { sb.append('(') .append(max) .append(')'); } else { sb.append(max); } return sb.toString(); }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * <p>Gets a string representation of the character range.</p> * * @return string representation of this range */ public String toString() { if (iToString == null) { StrBuilder buf = new StrBuilder(4); if (isNegated()) { buf.append('^'); } buf.append(start); if (start != end) { buf.append('-'); buf.append(end); } iToString = buf.toString(); } return iToString; }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * <p>Gets the range as a <code>String</code>.</p> * * <p>The format of the String is 'Range[<i>min</i>,<i>max</i>]'.</p> * * <p>This implementation uses the {@link #getMinimumNumber()} and * {@link #getMaximumNumber()} methods. * Subclasses may be able to optimise this.</p> * * @return the <code>String</code> representation of this range */ public String toString() { StrBuilder buf = new StrBuilder(32); buf.append("Range["); buf.append(getMinimumNumber()); buf.append(','); buf.append(getMaximumNumber()); buf.append(']'); return buf.toString(); }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * <p>Gets the fraction as a <code>String</code>.</p> * * <p>The format used is '<i>numerator</i>/<i>denominator</i>' always. * * @return a <code>String</code> form of the fraction */ public String toString() { if (toString == null) { toString = new StrBuilder(32) .append(getNumerator()) .append('/') .append(getDenominator()).toString(); } return toString; }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
return new StrBuilder(start + overlay.length() + text.length() - end + 1) .append(text.substring(0, start)) .append(overlay) .append(text.substring(end)) .toString();
/** * Converts a class name to a JLS style class name. * * @param className the class name * @return the converted name */ private static String toCanonicalName(String className) { className = StringUtils.deleteWhitespace(className); if (className == null) { throw new NullArgumentException("className"); } else if (className.endsWith("[]")) { StrBuilder classNameBuffer = new StrBuilder(); while (className.endsWith("[]")) { className = className.substring(0, className.length() - 2); classNameBuffer.append("["); } String abbreviation = (String) abbreviationMap.get(className); if (abbreviation != null) { classNameBuffer.append(abbreviation); } else { classNameBuffer.append("L").append(className).append(";"); } className = classNameBuffer.toString(); } return className; }
/** * Replaces all the occurrences of variables with their matching values * from the resolver using the given source array as a template. * The array is not altered by this method. * * @param source the character array to replace in, not altered, null returns null * @return the result of the replace operation */ public String replace(char[] source) { if (source == null) { return null; } StrBuilder buf = new StrBuilder(source.length).append(source); substitute(buf, 0, source.length); return buf.toString(); }