Path: csiph.com!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: Collator (1.8.0_77) Date: 8 Apr 2016 00:46:46 GMT Organization: Private site at Eddersheim, Germany Lines: 28 Distribution: world Message-ID: References: X-Trace: individual.net 2l0uG4q11dur/q7J49fjjwJcSzGY2tm3K9WpSiTuh7gQN716qc Cancel-Lock: sha1:SX5pYoSgebi6vUh6EwRFuAld6oI= Xref: csiph.com comp.lang.java.programmer:34086 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 "I'm a mechanic, not a doctor." Volker Borchert