Merge
authornaoto
Thu, 09 Dec 2010 15:26:22 -0800
changeset 7510 c91446dcf4eb
parent 7508 9782d88e18a3 (current diff)
parent 7509 bc7eaae38fff (diff)
child 7511 54a6d9105e27
Merge
--- a/jdk/src/share/classes/java/text/CollationElementIterator.java	Thu Dec 09 15:22:05 2010 -0800
+++ b/jdk/src/share/classes/java/text/CollationElementIterator.java	Thu Dec 09 15:26:22 2010 -0800
@@ -79,9 +79,13 @@
  * <pre>
  *
  *  String testString = "This is a test";
- *  RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)Collator.getInstance();
- *  CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString);
- *  int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());
+ *  Collator col = Collator.getInstance();
+ *  if (col instanceof RuleBasedCollator) {
+ *      RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)col;
+ *      CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString);
+ *      int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());
+ *          :
+ *  }
  * </pre>
  * </blockquote>
  *
@@ -93,6 +97,10 @@
  * is its primary order; the next 8 bits is the secondary order and the
  * 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                RuleBasedCollator
  * @author             Helena Shih, Laura Werner, Richard Gillam