ICU-9072 modify CurrencyDisplayNames API - fix docs to reflect changed semantics of 'to' data

X-SVN-Rev: 31524
This commit is contained in:
Doug Felt 2012-02-27 19:18:40 +00:00
parent 3ba55d3843
commit fe4bb98547
2 changed files with 10 additions and 13 deletions

View File

@ -20,15 +20,12 @@ import com.ibm.icu.util.TimeZone;
* *
* A note about currency dates. The CLDR data provides data to the day, * A note about currency dates. The CLDR data provides data to the day,
* inclusive. The date information used by CurrencyInfo and CurrencyFilter * inclusive. The date information used by CurrencyInfo and CurrencyFilter
* is represented by milliseconds, which is overly precise. These values * is represented by milliseconds, which is overly precise. These times are
* represent the CLDR data by using the millisecond value at the very start * in GMT, so queries involving dates should use GMT times, but more generally
* of a day to represent that day. Thus you must be careful when converting * you should avoid relying on time of day in queries.
* these values to and from actual times. For example, if you construct
* a time representing 12 noon GMT, and query the currencies available at that
* time, you will not return a currency whose last day of availablilty was on
* that day, since the time you provided is after the start of the day.
* *
* This class is not intended for public subclassing. * This class is not intended for public subclassing.
*
* @draft ICU 4.4 * @draft ICU 4.4
* @provisional This API might change or be removed in a future release. * @provisional This API might change or be removed in a future release.
*/ */
@ -385,7 +382,7 @@ public class CurrencyMetaInfo {
/** /**
* Date at which the currency stopped being officially used in the region. * Date at which the currency stopped being officially used in the region.
* This is midnight at the start of the last day on which the currency was used, GMT. * This is one millisecond before midnight at the end of the last day on which the currency was used, GMT.
* If there is no date, this is Long.MAX_VALUE. * If there is no date, this is Long.MAX_VALUE.
* *
* @draft ICU 4.4 * @draft ICU 4.4
@ -408,7 +405,7 @@ public class CurrencyMetaInfo {
* @param region region code * @param region region code
* @param code currency code * @param code currency code
* @param from start date in milliseconds. This is midnight at the start of the first day on which the currency was used, GMT. * @param from start date in milliseconds. This is midnight at the start of the first day on which the currency was used, GMT.
* @param to end date in milliseconds. This is midnight at the start of the last day on which the currency was used, GMT. * @param to end date in milliseconds. This is one second before midnight at the end of the last day on which the currency was used, GMT.
* @param priority priority value, 0 is highest priority, increasing values are lower * @param priority priority value, 0 is highest priority, increasing values are lower
* @draft ICU 4.4 * @draft ICU 4.4
* @provisional This API might change or be removed in a future release. * @provisional This API might change or be removed in a future release.

View File

@ -207,7 +207,7 @@ public class CurrencyTest extends TestFmwk {
} }
} }
// Provide better code coverage for the CurrencyDisplayNames class // A real test of the CurrencyDisplayNames class.
public void TestCurrencyDisplayNames() { public void TestCurrencyDisplayNames() {
if (!CurrencyDisplayNames.hasData()) { if (!CurrencyDisplayNames.hasData()) {
errln("hasData() should return true."); errln("hasData() should return true.");
@ -263,7 +263,7 @@ public class CurrencyTest extends TestFmwk {
assertNull("no fallback from unknown locale" + ln , cdn); assertNull("no fallback from unknown locale" + ln , cdn);
} }
// Provide better code coverage for the CurrencyData class // Coverage-only test of CurrencyData
public void TestCurrencyData() { public void TestCurrencyData() {
CurrencyData.DefaultInfo info_fallback = (CurrencyData.DefaultInfo)CurrencyData.DefaultInfo.getWithFallback(true); CurrencyData.DefaultInfo info_fallback = (CurrencyData.DefaultInfo)CurrencyData.DefaultInfo.getWithFallback(true);
if (info_fallback == null) { if (info_fallback == null) {
@ -324,7 +324,7 @@ public class CurrencyTest extends TestFmwk {
} }
} }
// Add a real test of CurrencyMetaInfo, the below one looks like code to exercise coverage only. // A real test of CurrencyMetaInfo.
public void testCurrencyMetaInfoRanges() { public void testCurrencyMetaInfoRanges() {
CurrencyMetaInfo metainfo = CurrencyMetaInfo.getInstance(true); CurrencyMetaInfo metainfo = CurrencyMetaInfo.getInstance(true);
assertNotNull("have metainfo", metainfo); assertNotNull("have metainfo", metainfo);
@ -378,7 +378,7 @@ public class CurrencyTest extends TestFmwk {
assertEquals("millisecond is 0", 0, cal.get(GregorianCalendar.MILLISECOND)); assertEquals("millisecond is 0", 0, cal.get(GregorianCalendar.MILLISECOND));
} }
// Provide better code coverage for the CurrencyMetaInfo class // Coverage-only test of the CurrencyMetaInfo class
public void TestCurrencyMetaInfo() { public void TestCurrencyMetaInfo() {
CurrencyMetaInfo metainfo = CurrencyMetaInfo.getInstance(); CurrencyMetaInfo metainfo = CurrencyMetaInfo.getInstance();
if (metainfo == null) { if (metainfo == null) {