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) { * if (col instanceof RuleBasedCollator ruleBasedCollator) {
* RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)col;
* CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString); * CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString);
* int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next()); * int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());
* : * \u22ee
* }
* } * }
* </pre>
* </blockquote> * </blockquote>
* *
* <p> * <p>