Class AffixUtils

java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.number.AffixUtils

public class AffixUtils extends Object
Performs manipulations on affix patterns: the prefix and suffix strings associated with a decimal format pattern. For example:
Affix Pattern Example Unescaped (Formatted) String
abc abc
ab- ab−
ab'-' ab-
ab'' ab'
To manually iterate over tokens in a literal string, use the following pattern, which is designed to be efficient.
 long tag = 0L;
 while (AffixPatternUtils.hasNext(tag, patternString)) {
     tag = AffixPatternUtils.nextToken(tag, patternString);
     int typeOrCp = AffixPatternUtils.getTypeOrCp(tag);
     switch (typeOrCp) {
     case AffixPatternUtils.TYPE_MINUS_SIGN:
         // Current token is a minus sign.
         break;
     case AffixPatternUtils.TYPE_PLUS_SIGN:
         // Current token is a plus sign.
         break;
     case AffixPatternUtils.TYPE_PERCENT:
         // Current token is a percent sign.
         break;
     // ... other types ...
     default:
         // Current token is an arbitrary code point.
         // The variable typeOrCp is the code point.
         break;
     }
 }