diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-07 18:40:08 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-07 18:40:08 +0000 |
commit | 2667bdcefd2d6989492b69b4a59fa495bc3d6636 (patch) | |
tree | 195faa2550e69c0ed1060d2bf90a2b1c688588a5 /libjava/java/text/CollationKey.java | |
parent | 3f71441c93f32f6e977f7c775a4455b7d4b7cce9 (diff) | |
download | ppe42-gcc-2667bdcefd2d6989492b69b4a59fa495bc3d6636.tar.gz ppe42-gcc-2667bdcefd2d6989492b69b4a59fa495bc3d6636.zip |
2004-01-07 Michael Koch <konqueror@gmx.de>
* java/text/CollationElementIterator.java
(textIndex): Renamed from index.
* java/text/CollationKey.java
(collator): New member.
(CollationKey): New argument for parent collator.
(equals): Check for same collator, source string and key array.
* java/text/RuleBasedCollator.java:
Reformated.
(RuleBasedCollator): Don't re-initialize frenchAccents with default
value.
(getCollationElementIterator): Rewritten.
(getCollationKey): Added new argument to CollationKey constructor.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75510 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/text/CollationKey.java')
-rw-r--r-- | libjava/java/text/CollationKey.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libjava/java/text/CollationKey.java b/libjava/java/text/CollationKey.java index f7e3148c50b..8859b320463 100644 --- a/libjava/java/text/CollationKey.java +++ b/libjava/java/text/CollationKey.java @@ -66,6 +66,11 @@ package java.text; public final class CollationKey implements Comparable { /** + * This is the <code>Collator</code> this object was created from. + */ + private Collator collator; + + /** * This is the <code>String</code> this object represents. */ private String originalText; @@ -75,9 +80,10 @@ public final class CollationKey implements Comparable */ private int[] key; - CollationKey (CollationElementIterator iter, String originalText, - int strength) + CollationKey(Collator collator, CollationElementIterator iter, + String originalText, int strength) { + this.collator = collator; this.originalText = originalText; // Compute size of required array. @@ -153,12 +159,14 @@ public final class CollationKey implements Comparable CollationKey ck = (CollationKey) obj; - if (key.length != ck.key.length) + if (ck.collator != collator) return false; - for (int i = 0; i < key.length; ++i) - if (key[i] != ck.key[i]) - return false; + if (!ck.getSourceString ().equals (getSourceString ())) + return false; + + if (!ck.toByteArray ().equals (toByteArray ())) + return false; return true; } |