Tabnine Logo
StringBuilder.setCharAt
Code IndexAdd Tabnine to your IDE (free)

How to use
setCharAt
method
in
java.lang.StringBuilder

Best Java code snippets using java.lang.StringBuilder.setCharAt (Showing top 20 results out of 8,091)

origin: netty/netty

  private static void appendHexDumpRowPrefix(StringBuilder dump, int row, int rowStartIndex) {
    if (row < HEXDUMP_ROWPREFIXES.length) {
      dump.append(HEXDUMP_ROWPREFIXES[row]);
    } else {
      dump.append(NEWLINE);
      dump.append(Long.toHexString(rowStartIndex & 0xFFFFFFFFL | 0x100000000L));
      dump.setCharAt(dump.length() - 9, '|');
      dump.append('|');
    }
  }
}
origin: netty/netty

/**
 * Creates a new ephemeral port based on the ID of the specified channel.
 * Note that we prepend an upper-case character so that it never conflicts with
 * the addresses created by a user, which are always lower-cased on construction time.
 */
LocalAddress(Channel channel) {
  StringBuilder buf = new StringBuilder(16);
  buf.append("local:E");
  buf.append(Long.toHexString(channel.hashCode() & 0xFFFFFFFFL | 0x100000000L));
  buf.setCharAt(7, ':');
  id = buf.substring(6);
  strVal = buf.toString();
}
origin: prestodb/presto

private static String convertToAsciiNumber(String convId) {
  StringBuilder buf = new StringBuilder(convId);
  for (int i = 0; i < buf.length(); i++) {
    char ch = buf.charAt(i);
    int digit = Character.digit(ch, 10);
    if (digit >= 0) {
      buf.setCharAt(i, (char) ('0' + digit));
    }
  }
  return buf.toString();
}
origin: netty/netty

  @Override
  protected StringBuilder toStringBuilder() {
    StringBuilder buf = super.toStringBuilder();
    buf.setCharAt(buf.length() - 1, ',');

    return buf.append(" task: ")
         .append(task)
         .append(')');
  }
}
origin: netty/netty

@Override
protected StringBuilder toStringBuilder() {
  StringBuilder buf = super.toStringBuilder();
  buf.setCharAt(buf.length() - 1, ',');
  return buf.append(" id: ")
       .append(id)
       .append(", deadline: ")
       .append(deadlineNanos)
       .append(", period: ")
       .append(periodNanos)
       .append(')');
}
origin: redisson/redisson

  private static void appendHexDumpRowPrefix(StringBuilder dump, int row, int rowStartIndex) {
    if (row < HEXDUMP_ROWPREFIXES.length) {
      dump.append(HEXDUMP_ROWPREFIXES[row]);
    } else {
      dump.append(NEWLINE);
      dump.append(Long.toHexString(rowStartIndex & 0xFFFFFFFFL | 0x100000000L));
      dump.setCharAt(dump.length() - 9, '|');
      dump.append('|');
    }
  }
}
origin: apache/incubator-druid

private void removeLastComma()
{
 assert sb.charAt(sb.length() - 2) == ',' && sb.charAt(sb.length() - 1) == '\n';
 sb.setCharAt(sb.length() - 2, '\n');
 sb.setLength(sb.length() - 1);
}
origin: redisson/redisson

/**
 * Creates a new ephemeral port based on the ID of the specified channel.
 * Note that we prepend an upper-case character so that it never conflicts with
 * the addresses created by a user, which are always lower-cased on construction time.
 */
LocalAddress(Channel channel) {
  StringBuilder buf = new StringBuilder(16);
  buf.append("local:E");
  buf.append(Long.toHexString(channel.hashCode() & 0xFFFFFFFFL | 0x100000000L));
  buf.setCharAt(7, ':');
  id = buf.substring(6);
  strVal = buf.toString();
}
origin: joda-time/joda-time

private static String convertToAsciiNumber(String convId) {
  StringBuilder buf = new StringBuilder(convId);
  for (int i = 0; i < buf.length(); i++) {
    char ch = buf.charAt(i);
    int digit = Character.digit(ch, 10);
    if (digit >= 0) {
      buf.setCharAt(i, (char) ('0' + digit));
    }
  }
  return buf.toString();
}
origin: eclipse-vertx/vert.x

static CharSequence toLowerCase(CharSequence s) {
 StringBuilder buffer = null;
 int len = s.length();
 for (int index = 0; index < len; index++) {
  char c = s.charAt(index);
  if (c >= 'A' && c <= 'Z') {
   if (buffer == null) {
    buffer = new StringBuilder(s);
   }
   buffer.setCharAt(index, (char)(c + ('a' - 'A')));
  }
 }
 if (buffer != null) {
  return buffer.toString();
 } else {
  return s;
 }
}
origin: JodaOrg/joda-time

private static String convertToAsciiNumber(String convId) {
  StringBuilder buf = new StringBuilder(convId);
  for (int i = 0; i < buf.length(); i++) {
    char ch = buf.charAt(i);
    int digit = Character.digit(ch, 10);
    if (digit >= 0) {
      buf.setCharAt(i, (char) ('0' + digit));
    }
  }
  return buf.toString();
}
origin: redisson/redisson

  @Override
  protected StringBuilder toStringBuilder() {
    StringBuilder buf = super.toStringBuilder();
    buf.setCharAt(buf.length() - 1, ',');

    return buf.append(" task: ")
         .append(task)
         .append(')');
  }
}
origin: lets-blade/blade

private void registerRoutePatterns(HttpMethod httpMethod) {
  StringBuilder patternBuilder = patternBuilders.get(httpMethod);
  if (patternBuilder.length() > 1) {
    patternBuilder.setCharAt(patternBuilder.length() - 1, '$');
  }
  log.debug("Fast Route Method: {}, regex: {}", httpMethod, patternBuilder);
  regexRoutePatterns.put(httpMethod, Pattern.compile(patternBuilder.toString()));
}
origin: lets-blade/blade

private void registerRoutePatterns(HttpMethod httpMethod) {
  StringBuilder patternBuilder = patternBuilders.get(httpMethod);
  if (patternBuilder.length() > 1) {
    patternBuilder.setCharAt(patternBuilder.length() - 1, '$');
  }
  log.debug("Fast Route Method: {}, regex: {}", httpMethod, patternBuilder);
  regexRoutePatterns.put(httpMethod, Pattern.compile(patternBuilder.toString()));
}
origin: hibernate/hibernate-orm

private static String getJavaAttributeNameFromXMLOne(String attributeName) {
  StringBuilder annotationAttributeName = new StringBuilder( attributeName );
  int index = annotationAttributeName.indexOf( WORD_SEPARATOR );
  while ( index != -1 ) {
    annotationAttributeName.deleteCharAt( index );
    annotationAttributeName.setCharAt(
        index, Character.toUpperCase( annotationAttributeName.charAt( index ) )
    );
    index = annotationAttributeName.indexOf( WORD_SEPARATOR );
  }
  return annotationAttributeName.toString();
}
origin: redisson/redisson

@Override
protected StringBuilder toStringBuilder() {
  StringBuilder buf = super.toStringBuilder();
  buf.setCharAt(buf.length() - 1, ',');
  return buf.append(" id: ")
       .append(id)
       .append(", deadline: ")
       .append(deadlineNanos)
       .append(", period: ")
       .append(periodNanos)
       .append(')');
}
origin: robolectric/robolectric

private static String replaceLastDotWith$IfInnerStaticClass(String receiverClassName) {
 String[] splits = receiverClassName.split("\\.", 0);
 String staticInnerClassRegex = "[A-Z][a-zA-Z]*";
 if (splits.length > 1
   && splits[splits.length - 1].matches(staticInnerClassRegex)
   && splits[splits.length - 2].matches(staticInnerClassRegex)) {
  int lastDotIndex = receiverClassName.lastIndexOf(".");
  StringBuilder buffer = new StringBuilder(receiverClassName);
  buffer.setCharAt(lastDotIndex, '$');
  return buffer.toString();
 }
 return receiverClassName;
}
origin: apache/storm

private String getJsonFromTuples(List<? extends ITuple> tuples) throws SolrMapperException {
  final StringBuilder jsonListBuilder = new StringBuilder("[");
  for (ITuple tuple : tuples) {
    final String json = getJsonFromTuple(tuple);
    jsonListBuilder.append(json).append(",");
  }
  jsonListBuilder.setCharAt(jsonListBuilder.length() - 1, ']');
  return jsonListBuilder.toString();
}
origin: facebook/stetho

private static String capitalize(String str) {
 if (str == null || str.length() == 0 || Character.isTitleCase(str.charAt(0))) {
  return str;
 }
 StringBuilder buffer = new StringBuilder(str);
 buffer.setCharAt(0, Character.toTitleCase(buffer.charAt(0)));
 return buffer.toString();
}
origin: google/error-prone

 @Override
 public Description matchLiteral(LiteralTree literalTree, VisitorState state) {
  if (!matcher.matches(literalTree, state)) {
   return Description.NO_MATCH;
  }
  StringBuilder longLiteral = new StringBuilder(getLongLiteral(literalTree, state));
  longLiteral.setCharAt(longLiteral.length() - 1, 'L');
  Fix fix = SuggestedFix.replace(literalTree, longLiteral.toString());
  return describeMatch(literalTree, fix);
 }
}
java.langStringBuildersetCharAt

Popular methods of StringBuilder

  • append
  • toString
  • <init>
    Constructs a string builder initialized to the contents of the specified string. The initial capacit
  • length
  • setLength
  • charAt
  • deleteCharAt
  • insert
  • substring
  • delete
  • replace
  • indexOf
  • replace,
  • indexOf,
  • lastIndexOf,
  • reverse,
  • appendCodePoint,
  • getChars,
  • subSequence,
  • ensureCapacity,
  • trimToSize

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Notification (javax.management)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now