import java.util.Map;
import com.ibm.icu.text.CurrencyDisplayNames;
+import com.ibm.icu.text.DecimalFormatSymbols;
import com.ibm.icu.util.ULocale;
public class CurrencyData {
private final String[][] symbols = new String[SpacingType.COUNT.ordinal()][SpacingPattern.COUNT.ordinal()];
public static enum SpacingType { BEFORE, AFTER, COUNT };
- public static enum SpacingPattern { CURRENCY_MATCH, SURROUNDING_MATCH, INSERT_BETWEEN, COUNT };
+ public static enum SpacingPattern {
+ CURRENCY_MATCH(DecimalFormatSymbols.CURRENCY_SPC_CURRENCY_MATCH),
+ SURROUNDING_MATCH(DecimalFormatSymbols.CURRENCY_SPC_SURROUNDING_MATCH),
+ INSERT_BETWEEN(DecimalFormatSymbols.CURRENCY_SPC_INSERT),
+ COUNT;
+
+ SpacingPattern() {}
+ SpacingPattern(int value) { assert value == ordinal(); }
+ };
public CurrencySpacingInfo() {}
* {@icu} Indicates the currency match pattern used in {@link #getPatternForCurrencySpacing}.
* @stable ICU 4.2
*/
- public static final int CURRENCY_SPC_CURRENCY_MATCH =
- CurrencySpacingInfo.SpacingPattern.CURRENCY_MATCH.ordinal();
+ public static final int CURRENCY_SPC_CURRENCY_MATCH = 0;
/**
* {@icu} Indicates the surrounding match pattern used in {@link
* #getPatternForCurrencySpacing}.
* @stable ICU 4.2
*/
- public static final int CURRENCY_SPC_SURROUNDING_MATCH =
- CurrencySpacingInfo.SpacingPattern.SURROUNDING_MATCH.ordinal();
+ public static final int CURRENCY_SPC_SURROUNDING_MATCH = 1;
/**
* {@icu} Indicates the insertion value used in {@link #getPatternForCurrencySpacing}.
* @stable ICU 4.4
*/
- public static final int CURRENCY_SPC_INSERT =
- CurrencySpacingInfo.SpacingPattern.INSERT_BETWEEN.ordinal();
+ public static final int CURRENCY_SPC_INSERT = 2;
private String[] currencySpcBeforeSym;
private String[] currencySpcAfterSym;