93 * </pre></blockquote> 94 * The enum-based ranges are a super set of the bit mask-based ones. 95 * 96 * <p>If the two interfaces are mixed (including serialization), 97 * Unicode range values are mapped to their counterparts where such 98 * mapping is possible, such as {@code NumericShaper.Range.ARABIC} 99 * from/to {@code NumericShaper.ARABIC}. If any unmappable range 100 * values are specified, such as {@code NumericShaper.Range.BALINESE}, 101 * those ranges are ignored. 102 * 103 * <p><b>Decimal Digits Precedence</b></p> 104 * 105 * <p>A Unicode range may have more than one set of decimal digits. If 106 * multiple decimal digits sets are specified for the same Unicode 107 * range, one of the sets will take precedence as follows. 108 * 109 * <table class="plain"> 110 * <caption>NumericShaper constants precedence</caption> 111 * <thead> 112 * <tr> 113 * <th class="TableHeadingColor">Unicode Range</th> 114 * <th class="TableHeadingColor">{@code NumericShaper} Constants</th> 115 * <th class="TableHeadingColor">Precedence</th> 116 * </tr> 117 * </thead> 118 * <tbody> 119 * <tr> 120 * <td rowspan="2">Arabic</td> 121 * <td>{@link NumericShaper#ARABIC NumericShaper.ARABIC}<br> 122 * {@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}</td> 123 * <td>{@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}</td> 124 * </tr> 125 * <tr> 126 * <td>{@link NumericShaper.Range#ARABIC}<br> 127 * {@link NumericShaper.Range#EASTERN_ARABIC}</td> 128 * <td>{@link NumericShaper.Range#EASTERN_ARABIC}</td> 129 * </tr> 130 * </tbody> 131 * <tbody> 132 * <tr> 133 * <td>Tai Tham</td> 134 * <td>{@link NumericShaper.Range#TAI_THAM_HORA}<br> 135 * {@link NumericShaper.Range#TAI_THAM_THAM}</td> 136 * <td>{@link NumericShaper.Range#TAI_THAM_THAM}</td> 137 * </tr> 138 * </tbody> 139 * </table> 140 * 141 * @since 1.4 142 */ 143 144 public final class NumericShaper implements java.io.Serializable { 145 146 // For access from java.text.Bidi 147 static { 148 if (SharedSecrets.getJavaAWTFontAccess() == null) { 149 SharedSecrets.setJavaAWTFontAccess(new JavaAWTFontAccessImpl()); 150 } 151 } 152 153 /** 154 * A {@code NumericShaper.Range} represents a Unicode range of a 155 * script having its own decimal digits. For example, the {@link 156 * NumericShaper.Range#THAI} range has the Thai digits, THAI DIGIT 157 * ZERO (U+0E50) to THAI DIGIT NINE (U+0E59). 158 * 159 * <p>The {@code Range} enum replaces the traditional bit 160 * mask-based values (e.g., {@link NumericShaper#ARABIC}), and 161 * supports more Unicode ranges than the bit mask-based ones. For 162 * example, the following code using the bit mask: 163 * <blockquote><pre> | 93 * </pre></blockquote> 94 * The enum-based ranges are a super set of the bit mask-based ones. 95 * 96 * <p>If the two interfaces are mixed (including serialization), 97 * Unicode range values are mapped to their counterparts where such 98 * mapping is possible, such as {@code NumericShaper.Range.ARABIC} 99 * from/to {@code NumericShaper.ARABIC}. If any unmappable range 100 * values are specified, such as {@code NumericShaper.Range.BALINESE}, 101 * those ranges are ignored. 102 * 103 * <p><b>Decimal Digits Precedence</b></p> 104 * 105 * <p>A Unicode range may have more than one set of decimal digits. If 106 * multiple decimal digits sets are specified for the same Unicode 107 * range, one of the sets will take precedence as follows. 108 * 109 * <table class="plain"> 110 * <caption>NumericShaper constants precedence</caption> 111 * <thead> 112 * <tr> 113 * <th scope="col">Unicode Range 114 * <th scope="col">{@code NumericShaper} Constants 115 * <th scope="col">Precedence 116 * </thead> 117 * <tbody> 118 * <tr> 119 * <th scope="row" rowspan="2">Arabic 120 * <td>{@link NumericShaper#ARABIC NumericShaper.ARABIC} 121 * <br> 122 * {@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC} 123 * <td>{@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC} 124 * </tr> 125 * <tr> 126 * <th scope="row">{@link NumericShaper.Range#ARABIC} 127 * <br> 128 * {@link NumericShaper.Range#EASTERN_ARABIC} 129 * <td>{@link NumericShaper.Range#EASTERN_ARABIC} 130 * <tr> 131 * <th scope="row">Tai Tham 132 * <td>{@link NumericShaper.Range#TAI_THAM_HORA} 133 * <br> 134 * {@link NumericShaper.Range#TAI_THAM_THAM} 135 * <td>{@link NumericShaper.Range#TAI_THAM_THAM} 136 * </tbody> 137 * </table> 138 * 139 * @since 1.4 140 */ 141 public final class NumericShaper implements java.io.Serializable { 142 143 // For access from java.text.Bidi 144 static { 145 if (SharedSecrets.getJavaAWTFontAccess() == null) { 146 SharedSecrets.setJavaAWTFontAccess(new JavaAWTFontAccessImpl()); 147 } 148 } 149 150 /** 151 * A {@code NumericShaper.Range} represents a Unicode range of a 152 * script having its own decimal digits. For example, the {@link 153 * NumericShaper.Range#THAI} range has the Thai digits, THAI DIGIT 154 * ZERO (U+0E50) to THAI DIGIT NINE (U+0E59). 155 * 156 * <p>The {@code Range} enum replaces the traditional bit 157 * mask-based values (e.g., {@link NumericShaper#ARABIC}), and 158 * supports more Unicode ranges than the bit mask-based ones. For 159 * example, the following code using the bit mask: 160 * <blockquote><pre> |