stringbuffer
-
Consider for example usage of the thread safe StringBuffer .
举例来说,考虑一下线程安全的StringBuffer的用法。
-
Public synchronized StringBuffer insert ( int offset , String str );
用来在字符串的索引offset位置处插入字符串str。
-
However , there is a performance penalty here , since a StringBuffer must work to transparently increase its size and shift the data around .
不过此处有性能损失,因为StringBuffer必须透明地增加其大小和对数据移位。
-
In this case , the StringBuffer has non-local scope and can be accessed by several threads .
在这个例子中,StringBuffer的作用域是非局部的,可以被多个线程访问。
-
Changing it to StringBuffer , however , will not be flagged as problem , because it does have a length () method .
然而如果将其变成StringBuffer,问题就不会标记出来,因为StringBuffer的确具有方法length()。
-
This section explains how to integrate ropes into a Java application and compares rope performance with that of String and StringBuffer .
这一节将解释如何将rope集成进Java应用程序,并比较rope与String和StringBuffer的性能。
-
The familiar advice is ; use StringBuffer instead of a String if you are going to be mutating it .
一个类似的建议是,如果你希望字符串是可变的,就应该使用StringBuffer。
-
String is immutable and if we are doing work that requires mutations , StringBuffer is a less costly alternative .
String是不可变的,但如果我们的工作需要字符串有很多变化,StringBuffer将是一个开销较低的选择。
-
If the binding corresponds to a variable , it creates a StringBuffer containing the variable 's name , a colon , and its type .
如果该绑定和变量相对应,贡献器会创建一个包含该变量名、冒号和其类型的StringBuffer。
-
You can sometimes further improve performance by setting the initial capacity of a StringBuffer ; the class is designed to automatically grow when it can no longer hold all its data .
有时可以通过设置StringBuffer的初始容量进一步提高性能;该类的设计使其可以在不能保存全部数据时自动扩大容量。
-
The IBuffer interface is similar to StringBuffer , the principal difference being that changing the buffer associated with a compilation unit updates the corresponding elements of the Java model .
IBuffer接口类似于StringBuffer,其原理不同之处在于,更改与编译单元相关的缓冲区更新了Java模型的对应元素。
-
Given the single threaded nature of this benchmark , I was fully expecting Escape Analysis to elide the lock thus rendering StringBuffer performance equivalent to that of StringBuilder .
明确了这个基准测试的单线程化的本质后,我期待着逸出分析会消除锁,从而将StringBuffer的性能提到了与StringBuilder相同的水平。
-
If the IBinding is an IFunction , the contributor forms a StringBuffer containing the function 's name and parameters & separated by commas and surrounded by parentheses .
如果IBinding是一个IFunction,贡献器会构造一个包含该函数名和参数(由逗号隔离并用圆括号括住)的StringBuffer。