本文整理了Java中java.lang.StringBuilder.length()
方法的一些代码示例,展示了StringBuilder.length()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StringBuilder.length()
方法的具体详情如下:
包路径:java.lang.StringBuilder
类名称:StringBuilder
方法名:length
暂无
代码示例来源:origin: spring-projects/spring-framework
private void clear(StringBuilder sb) {
sb.delete(0, sb.length());
}
}
代码示例来源:origin: spring-projects/spring-framework
private void appendDirective(StringBuilder builder, String value) {
if (builder.length() > 0) {
builder.append(", ");
}
builder.append(value);
}
代码示例来源:origin: spring-projects/spring-framework
public void removeTrailingSlash() {
int index = this.path.length() - 1;
if (this.path.charAt(index) == '/') {
this.path.deleteCharAt(index);
}
}
代码示例来源:origin: spring-projects/spring-framework
private static String quote(StringBuilder builder) {
return (builder.length() > 0 ? Pattern.quote(builder.toString()) : "");
}
}
代码示例来源:origin: spring-projects/spring-framework
public void write(char ch) {
if (ch == '\n' && this.buffer.length() > 0) {
logger.debug(this.buffer.toString());
this.buffer.setLength(0);
}
else {
this.buffer.append(ch);
}
}
代码示例来源:origin: apache/incubator-dubbo
public void write(char ch) {
if (ch == '\n' && _sb.length() > 0) {
_log.log(_level, _sb.toString());
_sb.setLength(0);
} else
_sb.append((char) ch);
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public void write(char[] buffer, int offset, int length) {
for (int i = 0; i < length; i++) {
char ch = buffer[offset + i];
if (ch == '\n' && _sb.length() > 0) {
_log.log(_level, _sb.toString());
_sb.setLength(0);
} else
_sb.append((char) ch);
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public void write(char[] buffer, int offset, int length) {
for (int i = 0; i < length; i++) {
char ch = buffer[offset + i];
if (ch == '\n' && _sb.length() > 0) {
_log.log(_level, _sb.toString());
_sb.setLength(0);
} else
_sb.append((char) ch);
}
}
代码示例来源:origin: apache/incubator-dubbo
public static String join(List<String> list, String separator) {
StringBuilder sb = new StringBuilder();
for (String ele : list) {
if (sb.length() > 0) {
sb.append(separator);
}
sb.append(ele);
}
return sb.toString();
}
代码示例来源:origin: apache/incubator-dubbo
public static String join(List<String> list, String separator) {
StringBuilder sb = new StringBuilder();
for (String ele : list) {
if (sb.length() > 0) {
sb.append(separator);
}
sb.append(ele);
}
return sb.toString();
}
代码示例来源:origin: apache/incubator-dubbo
public void write(char ch) {
if (ch == '\n' && _sb.length() > 0) {
_log.log(_level, _sb.toString());
_sb.setLength(0);
} else
_sb.append((char) ch);
}
代码示例来源:origin: google/guava
/**
* Subclasses must call this method after finishing character processing, in order to ensure that
* any unterminated line in the buffer is passed to {@link #handleLine}.
*
* @throws IOException if an I/O error occurs
*/
protected void finish() throws IOException {
if (sawReturn || line.length() > 0) {
finishLine(false);
}
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public void accept(StringBuilder sb, Integer v) {
if (sb.length() > 0) {
sb.append("-");
}
sb.append(v);
}
}).toObservable().blockingLast().toString();
代码示例来源:origin: ReactiveX/RxJava
@Override
public void accept(StringBuilder sb, Integer v) {
if (sb.length() > 0) {
sb.append("-");
}
sb.append(v);
}
}).toFlowable().blockingLast().toString();
代码示例来源:origin: ReactiveX/RxJava
@Override
public void accept(StringBuilder sb, Integer v) {
if (sb.length() > 0) {
sb.append("-");
}
sb.append(v);
}
}).blockingGet().toString();
代码示例来源:origin: ReactiveX/RxJava
@Override
public void accept(StringBuilder sb, Integer v) {
if (sb.length() > 0) {
sb.append("-");
}
sb.append(v);
}
}).blockingGet().toString();
代码示例来源:origin: ReactiveX/RxJava
static <T> StringBuilder allSequenceFrequency(Map<Integer, List<T>> its) {
StringBuilder b = new StringBuilder();
for (Map.Entry<Integer, List<T>> e : its.entrySet()) {
if (b.length() > 0) {
b.append(", ");
}
b.append(e.getKey()).append("={");
b.append(sequenceFrequency(e.getValue()));
b.append("}");
}
return b;
}
static <T> StringBuilder sequenceFrequency(Iterable<T> it) {
代码示例来源:origin: ReactiveX/RxJava
static <T> StringBuilder allSequenceFrequency(Map<Integer, List<T>> its) {
StringBuilder b = new StringBuilder();
for (Map.Entry<Integer, List<T>> e : its.entrySet()) {
if (b.length() > 0) {
b.append(", ");
}
b.append(e.getKey()).append("={");
b.append(sequenceFrequency(e.getValue()));
b.append("}");
}
return b;
}
static <T> StringBuilder sequenceFrequency(Iterable<T> it) {
代码示例来源:origin: spring-projects/spring-framework
private void insertQueryParams() {
StringBuilder query = new StringBuilder();
for (String key : this.queryParams.keySet()) {
for (String value : this.queryParams.get(key)) {
this.servletRequest.addParameter(key, value);
query.append(query.length() > 0 ? "&" : "").append(key).append("=").append(value);
}
}
this.servletRequest.setQueryString(query.toString());
}
代码示例来源:origin: ReactiveX/RxJava
static void checkSchedulerBadMethod(String baseClassName) throws Exception {
File f = MaybeNo2Dot0Since.findSource(baseClassName);
if (f == null) {
return;
}
StringBuilder b = readFile(f);
StringBuilder e = new StringBuilder();
scanForBadMethod(b, "@SchedulerSupport", "Scheduler:", e, baseClassName);
if (e.length() != 0) {
System.out.println(e);
fail(e.toString());
}
}
内容来源于网络,如有侵权,请联系作者删除!