提交 1f7ff849 编写于 作者: N naoto

6486695: [Col] Doc: CollationElementIterator example assumes Collator.getInstance return type

Reviewed-by: okutsu
上级 ec401f34
...@@ -79,9 +79,13 @@ import sun.text.normalizer.NormalizerBase; ...@@ -79,9 +79,13 @@ import sun.text.normalizer.NormalizerBase;
* <pre> * <pre>
* *
* String testString = "This is a test"; * String testString = "This is a test";
* RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)Collator.getInstance(); * Collator col = Collator.getInstance();
* CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString); * if (col instanceof RuleBasedCollator) {
* int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next()); * RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)col;
* CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString);
* int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());
* :
* }
* </pre> * </pre>
* </blockquote> * </blockquote>
* *
...@@ -93,6 +97,10 @@ import sun.text.normalizer.NormalizerBase; ...@@ -93,6 +97,10 @@ import sun.text.normalizer.NormalizerBase;
* is its primary order; the next 8 bits is the secondary order and the * is its primary order; the next 8 bits is the secondary order and the
* last 8 bits is the tertiary order. * last 8 bits is the tertiary order.
* *
* <p><b>Note:</b> <code>CollationElementIterator</code> is a part of
* <code>RuleBasedCollator</code> implementation. It is only usable
* with <code>RuleBasedCollator</code> instances.
*
* @see Collator * @see Collator
* @see RuleBasedCollator * @see RuleBasedCollator
* @author Helena Shih, Laura Werner, Richard Gillam * @author Helena Shih, Laura Werner, Richard Gillam
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册