Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8140
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Jan Burse <janburse@fastmail.fm> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: StringBuilder |
| Date | Sun, 18 Sep 2011 22:13:12 +0200 |
| Organization | albasani.net |
| Lines | 44 |
| Message-ID | <j55jcp$9im$1@news.albasani.net> (permalink) |
| References | <96f358c8-a024-40db-b60b-300186c2f813@o10g2000vby.googlegroups.com> <j41fik$3qb$1@news.albasani.net> <j52jgd$iij$1@dont-email.me> <vp7a77lp3e5oe4h79pnmv95vb4lu13spmc@4ax.com> <GeednbWNqODBGOjTnZ2dnUVZ_rqdnZ2d@posted.palinacquisition> <j54nc9$tgk$1@dont-email.me> <j54rss$j3q$1@news.albasani.net> <j54svs$u9u$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net XgUi/9j9CypCCznhUyMLzXRNxm9TFsEhd7hzHM8fda2fERP5gqeTNa0zx3Q8Qt25MlnTEQ6QzVdantuZLRuj1g== |
| NNTP-Posting-Date | Sun, 18 Sep 2011 20:13:13 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="LjJ6wegsOF8e9zXY/5/qB4Oc5AVq3UsY20grqlpozJNf+zFi6i5fYWayWs7sJMHoZ3Gj7CvVrKQA4eUwB5E5771448JKTO3xp+ogCTll01rFY/9AU+jSYuxwqJPbQGIO"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Firefox/6.0.2 SeaMonkey/2.3.3 |
| In-Reply-To | <j54svs$u9u$1@dont-email.me> |
| Cancel-Lock | sha1:rfw+bc3h7eJLlpmZy77Xr3bqip8= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8140 |
Show key headers only | View raw
Eric Sosman schrieb: > I do not know whether buffer-sharing was dropped before, after, > or with the introduction of StringBuilder. The implementation advice comment was removed in 1.5 javadoc. It was still present in 1.4.1 javadoc: 1.4.1 javadoc: Converts to a string representing the data in this string buffer. A new String object is allocated and initialized to contain the character sequence currently represented by this string buffer. This String is then returned. Subsequent changes to the string buffer do not affect the contents of the String. Implementation advice: This method can be coded so as to create a new String object without allocating new memory to hold a copy of the character sequence. Instead, the string can share the memory used by the string buffer. Any subsequent operation that alters the content or capacity of the string buffer must then make a copy of the internal buffer at that time. This strategy is effective for reducing the amount of memory allocated by a string concatenation operation when it is implemented using a string buffer. http://download.oracle.com/javase/1.4.2/docs/api/java/lang/StringBuffer.html#toString%28%29 1.5 javadoc: Returns a string representing the data in this sequence. A new String object is allocated and initialized to contain the character sequence currently represented by this object. This String is then returned. Subsequent changes to this sequence do not affect the contents of the String. http://download.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuffer.html#toString%28%29 Bye
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Re: StringBuilder Stanimir Stamenkov <s7an10@netscape.net> - 2011-09-17 19:56 +0300
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-17 20:35 +0200
Re: StringBuilder Roedy Green <see_website@mindprod.com.invalid> - 2011-09-17 15:34 -0700
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 01:33 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 01:56 +0200
Re: StringBuilder Roedy Green <see_website@mindprod.com.invalid> - 2011-09-17 20:58 -0700
Re: StringBuilder Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-17 22:44 -0700
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 09:54 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 09:59 +0200
Re: StringBuilder Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-18 07:28 -0700
Re: StringBuilder Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-18 08:15 -0400
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 15:32 +0200
Re: StringBuilder Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-18 09:50 -0400
Re: StringBuilder Stanimir Stamenkov <s7an10@netscape.net> - 2011-09-18 17:08 +0300
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 22:13 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 22:29 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 22:39 +0200
Re: StringBuilder Roedy Green <see_website@mindprod.com.invalid> - 2011-09-19 09:45 -0700
csiph-web