Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22000

Re: String.substring in JDK 1.7.0_6+

From markspace <markspace@nospam.nospam>
Newsgroups comp.lang.java.programmer
Subject Re: String.substring in JDK 1.7.0_6+
Date 2013-02-01 22:55 -0800
Organization A noiseless patient Spider
Message-ID <keid8j$2og$1@dont-email.me> (permalink)
References <510c0a6a$0$8985$ba4acef3@reader.news.orange.fr> <510c9cea$0$80106$742ec2ed@news.sonic.net>

Show all headers | View raw


On 2/1/2013 8:58 PM, Kevin McMurtrie wrote:

>  and the usual parsers (Integer, Long, Float)
>still only accept a String.  Slow Strings it is.
>

This I agree is a bit of a bummer, it would be useful for the parsers to 
take CharSequence for flexibility.  Integers aren't hard to parse but 
floats and doubles are non-trivial.

Note however that Scanner accepts both Readable (a Reader) and 
ReadableByteChannel in its constructors.

>
> Side rant:
> Sun broke buffer sharing between StringBuffer and String back in Java 5.

Probably because Strings needed to be immutable and there's no way to do 
that when sharing a mutable buffer.

> we could still have a very fast
> StringBuffer.toString().

Nope, see above.

>  As a final F-U, none of classes can be
> extended even through there's no buffer sharing that can be hacked.
>

Probably because they don't want you doing stupid broken things, like 
trying to share buffers between immutable and mutable objects.

I still agree that CharSequence could be made more useful though, that's 
a good idea.  Hmmm.


Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

String.substring in JDK 1.7.0_6+ jlp <jlp@jlp.com> - 2013-02-01 19:33 +0100
  Re: String.substring in JDK 1.7.0_6+ markspace <markspace@nospam.nospam> - 2013-02-01 10:38 -0800
    Re: String.substring in JDK 1.7.0_6+ jlp <jlp@jlp.com> - 2013-02-01 19:42 +0100
      Re: String.substring in JDK 1.7.0_6+ markspace <markspace@nospam.nospam> - 2013-02-01 10:45 -0800
        Re: String.substring in JDK 1.7.0_6+ jlp <jlp@jlp.com> - 2013-02-01 19:57 +0100
          Re: String.substring in JDK 1.7.0_6+ markspace <markspace@nospam.nospam> - 2013-02-01 11:20 -0800
  Re: String.substring in JDK 1.7.0_6+ Jan Burse <janburse@fastmail.fm> - 2013-02-01 20:34 +0100
  Re: String.substring in JDK 1.7.0_6+ Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-02-01 20:58 -0800
    Re: String.substring in JDK 1.7.0_6+ markspace <markspace@nospam.nospam> - 2013-02-01 22:55 -0800
      Re: String.substring in JDK 1.7.0_6+ Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-02-02 08:43 -0800
        Re: String.substring in JDK 1.7.0_6+ markspace <markspace@nospam.nospam> - 2013-02-02 10:56 -0800
          Re: String.substring in JDK 1.7.0_6+ Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-02-02 14:46 -0800
            Re: String.substring in JDK 1.7.0_6+ markspace <markspace@nospam.nospam> - 2013-02-02 15:31 -0800
            Re: String.substring in JDK 1.7.0_6+ Robert Klemme <shortcutter@googlemail.com> - 2013-02-03 15:09 +0100

csiph-web