< prev index next >

src/java.base/share/classes/java/text/CollationElementIterator.java

Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb


 108  */
 109 public final class CollationElementIterator
 110 {
 111     /**
 112      * Null order which indicates the end of string is reached by the
 113      * cursor.
 114      */
 115     public static final int NULLORDER = 0xffffffff;
 116 
 117     /**
 118      * CollationElementIterator constructor.  This takes the source string and
 119      * the collation object.  The cursor will walk thru the source string based
 120      * on the predefined collation rules.  If the source string is empty,
 121      * NULLORDER will be returned on the calls to next().
 122      * @param sourceText the source string.
 123      * @param owner the collation object.
 124      */
 125     CollationElementIterator(String sourceText, RuleBasedCollator owner) {
 126         this.owner = owner;
 127         ordering = owner.getTables();
 128         if ( sourceText.length() != 0 ) {
 129             NormalizerBase.Mode mode =
 130                 CollatorUtilities.toNormalizerMode(owner.getDecomposition());
 131             text = new NormalizerBase(sourceText, mode);
 132         }
 133     }
 134 
 135     /**
 136      * CollationElementIterator constructor.  This takes the source string and
 137      * the collation object.  The cursor will walk thru the source string based
 138      * on the predefined collation rules.  If the source string is empty,
 139      * NULLORDER will be returned on the calls to next().
 140      * @param sourceText the source string.
 141      * @param owner the collation object.
 142      */
 143     CollationElementIterator(CharacterIterator sourceText, RuleBasedCollator owner) {
 144         this.owner = owner;
 145         ordering = owner.getTables();
 146         NormalizerBase.Mode mode =
 147             CollatorUtilities.toNormalizerMode(owner.getDecomposition());
 148         text = new NormalizerBase(sourceText, mode);




 108  */
 109 public final class CollationElementIterator
 110 {
 111     /**
 112      * Null order which indicates the end of string is reached by the
 113      * cursor.
 114      */
 115     public static final int NULLORDER = 0xffffffff;
 116 
 117     /**
 118      * CollationElementIterator constructor.  This takes the source string and
 119      * the collation object.  The cursor will walk thru the source string based
 120      * on the predefined collation rules.  If the source string is empty,
 121      * NULLORDER will be returned on the calls to next().
 122      * @param sourceText the source string.
 123      * @param owner the collation object.
 124      */
 125     CollationElementIterator(String sourceText, RuleBasedCollator owner) {
 126         this.owner = owner;
 127         ordering = owner.getTables();
 128         if (!sourceText.isEmpty()) {
 129             NormalizerBase.Mode mode =
 130                 CollatorUtilities.toNormalizerMode(owner.getDecomposition());
 131             text = new NormalizerBase(sourceText, mode);
 132         }
 133     }
 134 
 135     /**
 136      * CollationElementIterator constructor.  This takes the source string and
 137      * the collation object.  The cursor will walk thru the source string based
 138      * on the predefined collation rules.  If the source string is empty,
 139      * NULLORDER will be returned on the calls to next().
 140      * @param sourceText the source string.
 141      * @param owner the collation object.
 142      */
 143     CollationElementIterator(CharacterIterator sourceText, RuleBasedCollator owner) {
 144         this.owner = owner;
 145         ordering = owner.getTables();
 146         NormalizerBase.Mode mode =
 147             CollatorUtilities.toNormalizerMode(owner.getDecomposition());
 148         text = new NormalizerBase(sourceText, mode);


< prev index next >