ICU-9072 modify CurrencyDisplayNames API

X-SVN-Rev: 31258
This commit is contained in:
Doug Felt 2012-01-24 22:09:54 +00:00
parent 3b3b61e234
commit a5035b2c58
4 changed files with 29 additions and 31 deletions

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2009-2010, International Business Machines Corporation and *
* Copyright (C) 2009-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -124,7 +124,7 @@ public class CurrencyData {
}
@Override
public ULocale getLocale() {
public ULocale getULocale() {
return ULocale.ROOT;
}

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2009-2010, International Business Machines Corporation and *
* Copyright (C) 2009-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -19,7 +19,10 @@ import com.ibm.icu.util.ULocale;
public abstract class CurrencyDisplayNames {
/**
* Return an instance of CurrencyDisplayNames that provides information
* localized for display in the provided locale.
* localized for display in the provided locale. If there is no data for the
* provided locale, this falls back to the current default locale; if there
* is no data for that either, it falls back to the root locale.
*
* @param locale the locale into which to localize the names
* @return a CurrencyDisplayNames
* @draft ICU 4.4
@ -32,8 +35,8 @@ public abstract class CurrencyDisplayNames {
/**
* Returns true if currency display name data is available.
* @return true if currency display name data is available
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
* @internal
* @deprecated This API is ICU internal only.
*/
public static boolean hasData() {
return CurrencyData.provider.hasData();
@ -42,16 +45,14 @@ public abstract class CurrencyDisplayNames {
/**
* Returns the locale used to determine how to translate the currency names.
* This is not necessarily the same locale passed to {@link #getInstance(ULocale)}.
* If hasData is false, returns {@link com.ibm.icu.util.ULocale#ROOT}.
* @return the display locale
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public abstract ULocale getLocale();
public abstract ULocale getULocale();
/**
* Returns the symbol for the currency with the provided ISO code.
* If hasData is false, returns the provided ISO code.
* @param isoCode the three-letter ISO code.
* @return the display name.
* @draft ICU 4.4
@ -61,7 +62,6 @@ public abstract class CurrencyDisplayNames {
/**
* Returns the 'long name' for the currency with the provided ISO code.
* If hasData is false, returns the provided ISO code.
* @param isoCode the three-letter ISO code
* @return the display name
* @draft ICU 4.4
@ -71,7 +71,7 @@ public abstract class CurrencyDisplayNames {
/**
* Returns a 'plural name' for the currency with the provided ISO code corresponding to
* the pluralKey. If hasData is false, returns the provided ISO code.
* the pluralKey.
* @param isoCode the three-letter ISO code
* @param pluralKey the plural key, for example "one", "other"
* @return the display name
@ -83,7 +83,6 @@ public abstract class CurrencyDisplayNames {
/**
* Returns a mapping from localized symbols and currency codes to currency codes.
* If hasData is false, returns an empty map.
* The returned map is unmodifiable.
* @return the map
* @draft ICU 4.4
@ -93,7 +92,6 @@ public abstract class CurrencyDisplayNames {
/**
* Returns a mapping from localized names (standard and plural) to currency codes.
* If hasData is false, returns an empty map.
* The returned map is unmodifiable.
* @return the map
* @draft ICU 4.4

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2009-2011, International Business Machines Corporation and *
* Copyright (C) 2009-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -36,8 +36,8 @@ public class CurrencyMetaInfo {
/**
* Returns true if there is data for the currency meta info.
* @return true if there is actual data
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
* @internal
* @deprecated This API is ICU internal only.
*/
public static boolean hasData() {
return hasData;
@ -165,12 +165,12 @@ public class CurrencyMetaInfo {
* @param to date before which a currency must have been in use, or if equal to from,
* the date on which a currency must have been in use
* @return a filter
* @see #withRange(Date, Date)
* @see #withDateRange(Date, Date)
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public static CurrencyFilter onRange(Date from, Date to) {
return ALL.withRange(from, to);
public static CurrencyFilter onDateRange(Date from, Date to) {
return ALL.withDateRange(from, to);
}
/**
@ -216,11 +216,11 @@ public class CurrencyMetaInfo {
* @param from date on or after which the currency must have been in use
* @param to date before which the currency must have been in use
* @return the filter
* @see #onRange(Date, Date)
* @see #onDateRange(Date, Date)
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public CurrencyFilter withRange(Date from, Date to) {
public CurrencyFilter withDateRange(Date from, Date to) {
return new CurrencyFilter(this.region, this.currency, from, to);
}
@ -297,13 +297,13 @@ public class CurrencyMetaInfo {
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public final byte fractionDigits;
public final int fractionDigits;
/**
* Rounding increment used when displaying this currency.
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public final byte roundingIncrement;
public final int roundingIncrement;
/**
* Constructor for CurrencyDigits.
@ -313,8 +313,8 @@ public class CurrencyMetaInfo {
* @provisional This API might change or be removed in a future release.
*/
public CurrencyDigits(int fractionDigits, int roundingIncrement) {
this.fractionDigits = (byte) fractionDigits;
this.roundingIncrement = (byte) roundingIncrement;
this.fractionDigits = fractionDigits;
this.roundingIncrement = roundingIncrement;
}
/**
@ -372,7 +372,7 @@ public class CurrencyMetaInfo {
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public final short priority;
public final int priority;
/**
* Constructs a currency info.
@ -389,7 +389,7 @@ public class CurrencyMetaInfo {
this.code = code;
this.from = from;
this.to = to;
this.priority = (short) priority;
this.priority = priority;
}
/**
@ -406,7 +406,7 @@ public class CurrencyMetaInfo {
///CLOVER:OFF
/**
* Returns the list of CurrencyInfos matching the provided filter. Results
* are ordered by country code, then by highest to lowest priority (0 is highest).
* are ordered by country code, then by highest to lowest priority (0 is highest).
* The returned list is unmodifiable.
* @param filter the filter to control which currency info to return
* @return the matching information
@ -429,7 +429,7 @@ public class CurrencyMetaInfo {
*/
public List<String> currencies(CurrencyFilter filter) {
return Collections.emptyList();
}
}
/**
* Returns the list of region codes matching the provided filter.

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2009-2011, International Business Machines Corporation and *
* Copyright (C) 2009-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -57,7 +57,7 @@ public class ICUCurrencyDisplayInfoProvider implements CurrencyDisplayInfoProvid
}
@Override
public ULocale getLocale() {
public ULocale getULocale() {
return rb.getULocale();
}