Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34079 > unrolled thread
| Started by | v.borchert@web.de (Volker Borchert) |
|---|---|
| First post | 2016-04-07 17:26 +0000 |
| Last post | 2016-04-08 00:46 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.java.programmer
Collator (1.8.0_77) v.borchert@web.de (Volker Borchert) - 2016-04-07 17:26 +0000
Re: Collator (1.8.0_77) v_borchert@despammed.com (Volker Borchert) - 2016-04-08 00:46 +0000
| From | v.borchert@web.de (Volker Borchert) |
|---|---|
| Date | 2016-04-07 17:26 +0000 |
| Subject | Collator (1.8.0_77) |
| Message-ID | <ne658u$755$1@Gaia.teknon.de> |
From reading the javadoc on the Collator strength values, I came to the conclusion that it should be possible to have a Collator that sorts "B" before "a" using TERTIARY. But - no. Strength apparently applies only to comparisons of "a" with "A", other than the javadoc on PRIMARY lured me into assuming. The use case: a somewhat generic OR-mapped table widget offering an API hook to sort by columns. Currently I'm using String's compareTo() and compareToIgnoreCase() to offer change case sensitivity without changing behaviour otherwise. Now I'd like to switch to Collator beause I want umlauts and ß handled properly, and am looking for a way to avoid expensively toLower()ing before each comparison, or less expensively but more footprintingly generating some sort of sort keys. Ideas anyone? vb -- "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>
[toc] | [next] | [standalone]
| From | v_borchert@despammed.com (Volker Borchert) |
|---|---|
| Date | 2016-04-08 00:46 +0000 |
| Message-ID | <ne6v1m$dkh$1@Gaia.teknon.de> |
| In reply to | #34079 |
Volker Borchert wrote: > From reading the javadoc on the Collator strength values, I came to > the conclusion that it should be possible to have a Collator that > sorts "B" before "a" using TERTIARY. But - no. Strength apparently > applies only to comparisons of "a" with "A", other than the javadoc > on PRIMARY lured me into assuming. > > The use case: a somewhat generic OR-mapped table widget offering an > API hook to sort by columns. Currently I'm using String's compareTo() > and compareToIgnoreCase() to offer change case sensitivity without > changing behaviour otherwise. Now I'd like to switch to Collator > beause I want umlauts and ß handled properly, and am looking > for a way to avoid expensively toLower()ing before each comparison, > or less expensively but more footprintingly generating some sort of > sort keys. > > Ideas anyone? Thinking it over, I come to the conclusion that my desire might be somewhat self-contradictory - language specifics like umlauts and pure technicals like (upper < lower) mixed up. So, it's probably best to forget about it. -- "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>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web