Search in sources :

Example 16 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project coprhd-controller by CoprHD.

the class TextUtils method formatCSV.

/**
 * Formats some values into comma-separated text.
 *
 * @param values
 *            the values to format.
 * @return the CSV text.
 */
public static String formatCSV(Iterable<String> values) {
    StrBuilder sb = new StrBuilder();
    for (String value : values) {
        sb.appendSeparator(",");
        sb.append("\"");
        if (StringUtils.isNotEmpty(value)) {
            for (int i = 0; i < value.length(); i++) {
                char ch = value.charAt(i);
                if (ch == '"') {
                    sb.append('"');
                }
                sb.append(ch);
            }
        }
        sb.append("\"");
    }
    return sb.toString();
}
Also used : StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 17 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project flink by apache.

the class Usage method getUsage.

private static String getUsage() {
    StrBuilder strBuilder = new StrBuilder();
    strBuilder.appendNewLine();
    strBuilder.appendln("Driver classes call algorithms from the Gelly library:");
    for (Class cls : DRIVERS) {
        strBuilder.append("  ").appendln(cls.getName());
    }
    strBuilder.appendNewLine();
    strBuilder.appendln("Example classes illustrate Gelly APIs or alternative algorithms:");
    for (Class cls : EXAMPLES) {
        strBuilder.append("  ").appendln(cls.getName());
    }
    return strBuilder.toString();
}
Also used : StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 18 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project RoboBinding by RoboBinding.

the class SourceCodeAssert method withSpacesRemoved.

private static String withSpacesRemoved(String text) {
    StrBuilder sb = new StrBuilder(text);
    sb.deleteAll("\r");
    sb.deleteAll("\t");
    sb.deleteAll("\n");
    sb.deleteAll(" ");
    return sb.toString();
}
Also used : StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 19 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project checker-framework by typetools.

the class GradleExample method main.

public static void main(final String[] args) {
    System.out.println("Hello World!");
    StrBuilder stb = new StrBuilder();
    // error on this line
    @NonNull Object nn = nullable;
    System.out.println(nn);
    List<@NonNull String> list = new ArrayList<>();
    // error on this line
    list.add(null);
}
Also used : NonNull(org.checkerframework.checker.nullness.qual.NonNull) ArrayList(java.util.ArrayList) StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 20 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project blue by kunstmusik.

the class Note method toString.

@Override
public String toString() {
    StrBuilder temp = new StrBuilder();
    int strSize = 1;
    for (int i = 0; i < fields.length; i++) {
        strSize += fields[i].length() + 1;
    }
    temp.ensureCapacity(strSize);
    temp.append("i");
    int size = fields.length;
    for (int i = 0; i < size; i++) {
        if (i == 2) {
            if (this.isTied) {
                temp.append("-");
            }
            temp.append(NumberUtilities.formatDouble(subjectiveDuration)).append("\t");
        } else {
            temp.append(fields[i]);
            if (i < size - 1) {
                temp.append("\t");
            }
        }
    }
    return temp.toString();
}
Also used : StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Aggregations

StrBuilder (org.apache.commons.lang3.text.StrBuilder)44 GenericInstrument (blue.orchestra.GenericInstrument)9 LinePoint (blue.components.lines.LinePoint)8 Instrument (blue.orchestra.Instrument)5 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)4 Parameter (blue.automation.Parameter)3 NoteParseException (blue.soundObject.NoteParseException)3 ArrayList (java.util.ArrayList)3 Arrangement (blue.Arrangement)2 CompileData (blue.CompileData)2 GlobalOrcSco (blue.GlobalOrcSco)2 Tables (blue.Tables)2 ParameterNameManager (blue.automation.ParameterNameManager)2 Line (blue.components.lines.Line)2 SoundObjectParameterLine (blue.components.lines.SoundObjectParameterLine)2 Mixer (blue.mixer.Mixer)2 TempoMapper (blue.noteProcessor.TempoMapper)2 StringChannelNameManager (blue.orchestra.blueSynthBuilder.StringChannelNameManager)2 EnvelopePoint (blue.orchestra.blueX7.EnvelopePoint)2 CsdRenderResult (blue.services.render.CsdRenderResult)2