8300356: Refactor code examples to use @snippet in java.text.CollationElementIterator

Reviewed-by: naoto
This commit is contained in:
Justin Lu 2023-01-19 22:35:24 +00:00 committed by Naoto Sato
parent dfcd65c271
commit fbbb27e770

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -76,17 +76,15 @@ import jdk.internal.icu.text.NormalizerBase;
* <p> * <p>
* Example of the iterator usage, * Example of the iterator usage,
* <blockquote> * <blockquote>
* <pre> * {@snippet lang=java :
* * String testString = "This is a test";
* String testString = "This is a test"; * Collator col = Collator.getInstance();
* Collator col = Collator.getInstance(); * if (col instanceof RuleBasedCollator ruleBasedCollator) {
* if (col instanceof RuleBasedCollator) { * CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString);
* RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)col; * int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());
* CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString); * \u22ee
* int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next()); * }
* : * }
* }
* </pre>
* </blockquote> * </blockquote>
* *
* <p> * <p>