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


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

Re: string case clauses

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Joshua Cranmer <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: string case clauses
Date Sun, 11 Sep 2011 12:00:15 -0500
Organization A noiseless patient Spider
Lines 15
Message-ID <j4ipg0$or7$1@dont-email.me> (permalink)
References <2oop671bkkrj4kg2cn59nq46ns1qg0n0qe@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Sun, 11 Sep 2011 17:00:48 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="WpcHJSul77m+zlbR9GVqkA"; logging-data="25447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iQcHUtxGoyGHUuDvIadVOxPbF52ZwCE4="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2
In-Reply-To <2oop671bkkrj4kg2cn59nq46ns1qg0n0qe@4ax.com>
Cancel-Lock sha1:ogy/FlPhNVoXTg2U0y9jOzq8oqU=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7811

Show key headers only | View raw


On 9/11/2011 11:35 AM, Roedy Green wrote:
> Has anyone looked at he code JavaC generates for the new String case
> clauses?  It is a simple linear search, a binary search, a HashMap?

<http://blogs.sun.com/darcy/entry/project_coin_string_switch_break> 
discusses the implementation a bit.

In short:
1. Switch on the hashcode.
2. Verify string equalities using a linear switch for all strings that 
have the same hashcode.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

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


Thread

string case clauses Roedy Green <see_website@mindprod.com.invalid> - 2011-09-11 09:35 -0700
  Re: string case clauses Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-09-11 12:00 -0500
    Re: string case clauses Roedy Green <see_website@mindprod.com.invalid> - 2011-09-11 15:33 -0700
      Re: string case clauses Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 21:56 -0400
        Re: string case clauses Lew <lewbloch@gmail.com> - 2011-09-11 20:54 -0700
          Re: string case clauses Arne Vajhøj <arne@vajhoej.dk> - 2011-09-12 18:58 -0400
      Re: string case clauses Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-11 20:05 -0700
        Re: string case clauses Roedy Green <see_website@mindprod.com.invalid> - 2011-09-14 12:13 -0700
          Re: string case clauses Patricia Shanahan <pats@acm.org> - 2011-09-14 12:36 -0700
          Re: string case clauses Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-14 18:01 -0700
            Re: string case clauses Lew <lewbloch@gmail.com> - 2011-09-14 20:05 -0700

csiph-web