Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10187
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | v_borchert@despammed.com (Volker Borchert) |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: case insensitive sort |
| Date | 23 Nov 2011 06:34:36 GMT |
| Organization | Private site at Eddersheim, Germany |
| Lines | 21 |
| Distribution | world |
| Message-ID | <jai45s$shg$1@Gaia.teknon.de> (permalink) |
| References | <nfvoc7t69mjhbed81u75k9v1j1nn4pcu73@4ax.com> <6vqdnf10be9KFlHTnZ2dnUVZ_rudnZ2d@earthlink.com> |
| X-Trace | individual.net dqJrW84EzDrhUDwvdSwM0AnLt/vOgnUMydp8W4diYkupNcRuPo |
| Cancel-Lock | sha1:lxL3ztsBNg0E61xmJyRV2aWhk+A= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10187 |
Show key headers only | View raw
Patricia Shanahan wrote: > Roedy Green wrote: > > However than will not give you what you really want. You probably > > want this if you want tidy-looking results. > > > > int diff = a.x.compareToIgnoreCase( b ); > > if ( diff != 0 ) return diff; > > return a.x.compareTo( b.x ); > > I think this needs more context. What is x? What are the types involved? > Why do you expect a.x and be to be comparable? I think that's a typo and should read b.x, and assume x is String. And the basic idea, to provide a consistent ordering within groups of items that compare equal ignoring case, is worth keeping in mind. -- "I'm a doctor, not a mechanic." Dr Leonard McCoy <mccoy@ncc1701.starfleet.fed> "I'm a mechanic, not a doctor." Volker Borchert <v_borchert@despammed.com>
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
case insensitive sort Roedy Green <see_website@mindprod.com.invalid> - 2011-11-22 21:06 -0800
Re: case insensitive sort Patricia Shanahan <pats@acm.org> - 2011-11-22 21:59 -0800
Re: case insensitive sort v_borchert@despammed.com (Volker Borchert) - 2011-11-23 06:34 +0000
Re: case insensitive sort Roedy Green <see_website@mindprod.com.invalid> - 2011-11-23 02:49 -0800
Re: case insensitive sort Roedy Green <see_website@mindprod.com.invalid> - 2011-11-23 02:46 -0800
Re: case insensitive sort Patricia Shanahan <pats@acm.org> - 2011-11-23 05:23 -0800
Re: case insensitive sort v_borchert@despammed.com (Volker Borchert) - 2011-11-23 19:32 +0000
Re: case insensitive sort dibs <dibs@dobs.dabs> - 2011-11-23 15:11 -0500
Re: case insensitive sort v_borchert@despammed.com (Volker Borchert) - 2011-11-24 05:03 +0000
Re: case insensitive sort Arne Vajhøj <arne@vajhoej.dk> - 2011-11-25 21:26 -0500
Re: case insensitive sort Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-26 14:23 +0000
Re: case insensitive sort Arne Vajhøj <arne@vajhoej.dk> - 2011-12-02 21:56 -0500
Re: case insensitive sort Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-12-04 10:43 +0000
csiph-web