ICU-12937 Withdraw MeasureUnit interfaces for coordinate units, and related data loading
X-SVN-Rev: 39599
This commit is contained in:
parent
46beebce64
commit
7b33e586f5
@ -41,7 +41,7 @@
|
||||
#include "standardplural.h"
|
||||
#include "unifiedcache.h"
|
||||
|
||||
#define MEAS_UNIT_COUNT 138
|
||||
#define MEAS_UNIT_COUNT 134
|
||||
#define WIDTH_INDEX_COUNT (UMEASFMT_WIDTH_NARROW + 1)
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
@ -288,10 +288,8 @@ struct UnitDataSink : public ResourceSink {
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.getType() == URES_STRING) {
|
||||
// Units like "coordinate" that don't have plural variants
|
||||
setFormatterIfAbsent(StandardPlural::OTHER, value, 0, errorCode);
|
||||
} else if (value.getType() == URES_TABLE) {
|
||||
// We no longer handle units like "coordinate" here (which do not have plural variants)
|
||||
if (value.getType() == URES_TABLE) {
|
||||
// Units that have plural variants
|
||||
ResourceTable patternTableTable = value.getTable(errorCode);
|
||||
if (U_FAILURE(errorCode)) { return; }
|
||||
@ -333,6 +331,8 @@ struct UnitDataSink : public ResourceSink {
|
||||
consumeCompoundPattern(key, value, errorCode);
|
||||
}
|
||||
}
|
||||
} else if (uprv_strcmp(key, "coordinate") == 0) {
|
||||
// special handling but we need to determine what that is
|
||||
} else {
|
||||
type = key;
|
||||
ResourceTable subtypeTable = value.getTable(errorCode);
|
||||
|
@ -40,21 +40,20 @@ static const int32_t gOffsets[] = {
|
||||
16,
|
||||
20,
|
||||
24,
|
||||
28,
|
||||
288,
|
||||
298,
|
||||
309,
|
||||
313,
|
||||
319,
|
||||
323,
|
||||
342,
|
||||
343,
|
||||
354,
|
||||
360,
|
||||
365,
|
||||
369,
|
||||
373,
|
||||
398
|
||||
285,
|
||||
295,
|
||||
306,
|
||||
310,
|
||||
316,
|
||||
320,
|
||||
339,
|
||||
340,
|
||||
351,
|
||||
357,
|
||||
362,
|
||||
366,
|
||||
370,
|
||||
395
|
||||
};
|
||||
|
||||
static const int32_t gIndexes[] = {
|
||||
@ -64,21 +63,20 @@ static const int32_t gIndexes[] = {
|
||||
16,
|
||||
20,
|
||||
24,
|
||||
28,
|
||||
28,
|
||||
38,
|
||||
24,
|
||||
34,
|
||||
45,
|
||||
49,
|
||||
53,
|
||||
55,
|
||||
59,
|
||||
63,
|
||||
82,
|
||||
83,
|
||||
94,
|
||||
100,
|
||||
78,
|
||||
79,
|
||||
90,
|
||||
96,
|
||||
101,
|
||||
105,
|
||||
109,
|
||||
113,
|
||||
138
|
||||
134
|
||||
};
|
||||
|
||||
// Must be sorted alphabetically.
|
||||
@ -88,7 +86,6 @@ static const char * const gTypes[] = {
|
||||
"area",
|
||||
"concentr",
|
||||
"consumption",
|
||||
"coordinate",
|
||||
"currency",
|
||||
"digital",
|
||||
"duration",
|
||||
@ -131,10 +128,6 @@ static const char * const gSubTypes[] = {
|
||||
"liter-per-kilometer",
|
||||
"mile-per-gallon",
|
||||
"mile-per-gallon-imperial",
|
||||
"east",
|
||||
"north",
|
||||
"south",
|
||||
"west",
|
||||
"ADP",
|
||||
"AED",
|
||||
"AFA",
|
||||
@ -178,6 +171,7 @@ static const char * const gSubTypes[] = {
|
||||
"BTN",
|
||||
"BWP",
|
||||
"BYB",
|
||||
"BYN",
|
||||
"BYR",
|
||||
"BZD",
|
||||
"CAD",
|
||||
@ -509,14 +503,14 @@ static const char * const gSubTypes[] = {
|
||||
|
||||
// Must be sorted by first value and then second value.
|
||||
static int32_t unitPerUnitToSingleUnit[][4] = {
|
||||
{330, 300, 17, 0},
|
||||
{332, 306, 17, 2},
|
||||
{334, 300, 17, 3},
|
||||
{334, 387, 4, 2},
|
||||
{334, 388, 4, 3},
|
||||
{348, 385, 3, 1},
|
||||
{351, 11, 16, 4},
|
||||
{390, 330, 4, 1}
|
||||
{327, 297, 16, 0},
|
||||
{329, 303, 16, 2},
|
||||
{331, 297, 16, 3},
|
||||
{331, 384, 4, 2},
|
||||
{331, 385, 4, 3},
|
||||
{345, 382, 3, 1},
|
||||
{348, 11, 15, 4},
|
||||
{387, 327, 4, 1}
|
||||
};
|
||||
|
||||
MeasureUnit *MeasureUnit::createGForce(UErrorCode &status) {
|
||||
@ -615,460 +609,452 @@ MeasureUnit *MeasureUnit::createMilePerGallonImperial(UErrorCode &status) {
|
||||
return MeasureUnit::create(4, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createEast(UErrorCode &status) {
|
||||
return MeasureUnit::create(5, 0, status);
|
||||
}
|
||||
// MeasureUnit *MeasureUnit::createEast(UErrorCode &status) {...}
|
||||
|
||||
MeasureUnit *MeasureUnit::createNorth(UErrorCode &status) {
|
||||
return MeasureUnit::create(5, 1, status);
|
||||
}
|
||||
// MeasureUnit *MeasureUnit::createNorth(UErrorCode &status) {...}
|
||||
|
||||
MeasureUnit *MeasureUnit::createSouth(UErrorCode &status) {
|
||||
return MeasureUnit::create(5, 2, status);
|
||||
}
|
||||
// MeasureUnit *MeasureUnit::createSouth(UErrorCode &status) {...}
|
||||
|
||||
MeasureUnit *MeasureUnit::createWest(UErrorCode &status) {
|
||||
return MeasureUnit::create(5, 3, status);
|
||||
}
|
||||
// MeasureUnit *MeasureUnit::createWest(UErrorCode &status) {...}
|
||||
|
||||
MeasureUnit *MeasureUnit::createBit(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 0, status);
|
||||
return MeasureUnit::create(6, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createByte(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 1, status);
|
||||
return MeasureUnit::create(6, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGigabit(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 2, status);
|
||||
return MeasureUnit::create(6, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGigabyte(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 3, status);
|
||||
return MeasureUnit::create(6, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilobit(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 4, status);
|
||||
return MeasureUnit::create(6, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilobyte(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 5, status);
|
||||
return MeasureUnit::create(6, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMegabit(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 6, status);
|
||||
return MeasureUnit::create(6, 6, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMegabyte(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 7, status);
|
||||
return MeasureUnit::create(6, 7, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createTerabit(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 8, status);
|
||||
return MeasureUnit::create(6, 8, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createTerabyte(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 9, status);
|
||||
return MeasureUnit::create(6, 9, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCentury(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 0, status);
|
||||
return MeasureUnit::create(7, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createDay(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 1, status);
|
||||
return MeasureUnit::create(7, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createHour(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 2, status);
|
||||
return MeasureUnit::create(7, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMicrosecond(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 3, status);
|
||||
return MeasureUnit::create(7, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMillisecond(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 4, status);
|
||||
return MeasureUnit::create(7, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMinute(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 5, status);
|
||||
return MeasureUnit::create(7, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMonth(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 6, status);
|
||||
return MeasureUnit::create(7, 6, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createNanosecond(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 7, status);
|
||||
return MeasureUnit::create(7, 7, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 8, status);
|
||||
return MeasureUnit::create(7, 8, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 9, status);
|
||||
return MeasureUnit::create(7, 9, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createYear(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 10, status);
|
||||
return MeasureUnit::create(7, 10, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) {
|
||||
return MeasureUnit::create(9, 0, status);
|
||||
return MeasureUnit::create(8, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMilliampere(UErrorCode &status) {
|
||||
return MeasureUnit::create(9, 1, status);
|
||||
return MeasureUnit::create(8, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createOhm(UErrorCode &status) {
|
||||
return MeasureUnit::create(9, 2, status);
|
||||
return MeasureUnit::create(8, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createVolt(UErrorCode &status) {
|
||||
return MeasureUnit::create(9, 3, status);
|
||||
return MeasureUnit::create(8, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCalorie(UErrorCode &status) {
|
||||
return MeasureUnit::create(10, 0, status);
|
||||
return MeasureUnit::create(9, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createFoodcalorie(UErrorCode &status) {
|
||||
return MeasureUnit::create(10, 1, status);
|
||||
return MeasureUnit::create(9, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createJoule(UErrorCode &status) {
|
||||
return MeasureUnit::create(10, 2, status);
|
||||
return MeasureUnit::create(9, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilocalorie(UErrorCode &status) {
|
||||
return MeasureUnit::create(10, 3, status);
|
||||
return MeasureUnit::create(9, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilojoule(UErrorCode &status) {
|
||||
return MeasureUnit::create(10, 4, status);
|
||||
return MeasureUnit::create(9, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilowattHour(UErrorCode &status) {
|
||||
return MeasureUnit::create(10, 5, status);
|
||||
return MeasureUnit::create(9, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGigahertz(UErrorCode &status) {
|
||||
return MeasureUnit::create(11, 0, status);
|
||||
return MeasureUnit::create(10, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createHertz(UErrorCode &status) {
|
||||
return MeasureUnit::create(11, 1, status);
|
||||
return MeasureUnit::create(10, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilohertz(UErrorCode &status) {
|
||||
return MeasureUnit::create(11, 2, status);
|
||||
return MeasureUnit::create(10, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMegahertz(UErrorCode &status) {
|
||||
return MeasureUnit::create(11, 3, status);
|
||||
return MeasureUnit::create(10, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createAstronomicalUnit(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 0, status);
|
||||
return MeasureUnit::create(11, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCentimeter(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 1, status);
|
||||
return MeasureUnit::create(11, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createDecimeter(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 2, status);
|
||||
return MeasureUnit::create(11, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createFathom(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 3, status);
|
||||
return MeasureUnit::create(11, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createFoot(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 4, status);
|
||||
return MeasureUnit::create(11, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createFurlong(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 5, status);
|
||||
return MeasureUnit::create(11, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createInch(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 6, status);
|
||||
return MeasureUnit::create(11, 6, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilometer(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 7, status);
|
||||
return MeasureUnit::create(11, 7, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createLightYear(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 8, status);
|
||||
return MeasureUnit::create(11, 8, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMeter(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 9, status);
|
||||
return MeasureUnit::create(11, 9, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMicrometer(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 10, status);
|
||||
return MeasureUnit::create(11, 10, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMile(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 11, status);
|
||||
return MeasureUnit::create(11, 11, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMileScandinavian(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 12, status);
|
||||
return MeasureUnit::create(11, 12, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMillimeter(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 13, status);
|
||||
return MeasureUnit::create(11, 13, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createNanometer(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 14, status);
|
||||
return MeasureUnit::create(11, 14, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createNauticalMile(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 15, status);
|
||||
return MeasureUnit::create(11, 15, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createParsec(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 16, status);
|
||||
return MeasureUnit::create(11, 16, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createPicometer(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 17, status);
|
||||
return MeasureUnit::create(11, 17, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createYard(UErrorCode &status) {
|
||||
return MeasureUnit::create(12, 18, status);
|
||||
return MeasureUnit::create(11, 18, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createLux(UErrorCode &status) {
|
||||
return MeasureUnit::create(13, 0, status);
|
||||
return MeasureUnit::create(12, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCarat(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 0, status);
|
||||
return MeasureUnit::create(13, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGram(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 1, status);
|
||||
return MeasureUnit::create(13, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilogram(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 2, status);
|
||||
return MeasureUnit::create(13, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 3, status);
|
||||
return MeasureUnit::create(13, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 4, status);
|
||||
return MeasureUnit::create(13, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMilligram(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 5, status);
|
||||
return MeasureUnit::create(13, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createOunce(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 6, status);
|
||||
return MeasureUnit::create(13, 6, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createOunceTroy(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 7, status);
|
||||
return MeasureUnit::create(13, 7, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createPound(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 8, status);
|
||||
return MeasureUnit::create(13, 8, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createStone(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 9, status);
|
||||
return MeasureUnit::create(13, 9, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createTon(UErrorCode &status) {
|
||||
return MeasureUnit::create(14, 10, status);
|
||||
return MeasureUnit::create(13, 10, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGigawatt(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 0, status);
|
||||
return MeasureUnit::create(14, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createHorsepower(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 1, status);
|
||||
return MeasureUnit::create(14, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilowatt(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 2, status);
|
||||
return MeasureUnit::create(14, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMegawatt(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 3, status);
|
||||
return MeasureUnit::create(14, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMilliwatt(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 4, status);
|
||||
return MeasureUnit::create(14, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createWatt(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 5, status);
|
||||
return MeasureUnit::create(14, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createHectopascal(UErrorCode &status) {
|
||||
return MeasureUnit::create(16, 0, status);
|
||||
return MeasureUnit::create(15, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createInchHg(UErrorCode &status) {
|
||||
return MeasureUnit::create(16, 1, status);
|
||||
return MeasureUnit::create(15, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMillibar(UErrorCode &status) {
|
||||
return MeasureUnit::create(16, 2, status);
|
||||
return MeasureUnit::create(15, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMillimeterOfMercury(UErrorCode &status) {
|
||||
return MeasureUnit::create(16, 3, status);
|
||||
return MeasureUnit::create(15, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createPoundPerSquareInch(UErrorCode &status) {
|
||||
return MeasureUnit::create(16, 4, status);
|
||||
return MeasureUnit::create(15, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKilometerPerHour(UErrorCode &status) {
|
||||
return MeasureUnit::create(17, 0, status);
|
||||
return MeasureUnit::create(16, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKnot(UErrorCode &status) {
|
||||
return MeasureUnit::create(17, 1, status);
|
||||
return MeasureUnit::create(16, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) {
|
||||
return MeasureUnit::create(17, 2, status);
|
||||
return MeasureUnit::create(16, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) {
|
||||
return MeasureUnit::create(17, 3, status);
|
||||
return MeasureUnit::create(16, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCelsius(UErrorCode &status) {
|
||||
return MeasureUnit::create(18, 0, status);
|
||||
return MeasureUnit::create(17, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createFahrenheit(UErrorCode &status) {
|
||||
return MeasureUnit::create(18, 1, status);
|
||||
return MeasureUnit::create(17, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGenericTemperature(UErrorCode &status) {
|
||||
return MeasureUnit::create(18, 2, status);
|
||||
return MeasureUnit::create(17, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createKelvin(UErrorCode &status) {
|
||||
return MeasureUnit::create(18, 3, status);
|
||||
return MeasureUnit::create(17, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createAcreFoot(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 0, status);
|
||||
return MeasureUnit::create(18, 0, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createBushel(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 1, status);
|
||||
return MeasureUnit::create(18, 1, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCentiliter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 2, status);
|
||||
return MeasureUnit::create(18, 2, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCubicCentimeter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 3, status);
|
||||
return MeasureUnit::create(18, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCubicFoot(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 4, status);
|
||||
return MeasureUnit::create(18, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCubicInch(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 5, status);
|
||||
return MeasureUnit::create(18, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCubicKilometer(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 6, status);
|
||||
return MeasureUnit::create(18, 6, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCubicMeter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 7, status);
|
||||
return MeasureUnit::create(18, 7, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCubicMile(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 8, status);
|
||||
return MeasureUnit::create(18, 8, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCubicYard(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 9, status);
|
||||
return MeasureUnit::create(18, 9, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCup(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 10, status);
|
||||
return MeasureUnit::create(18, 10, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCupMetric(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 11, status);
|
||||
return MeasureUnit::create(18, 11, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createDeciliter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 12, status);
|
||||
return MeasureUnit::create(18, 12, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createFluidOunce(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 13, status);
|
||||
return MeasureUnit::create(18, 13, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGallon(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 14, status);
|
||||
return MeasureUnit::create(18, 14, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGallonImperial(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 15, status);
|
||||
return MeasureUnit::create(18, 15, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createHectoliter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 16, status);
|
||||
return MeasureUnit::create(18, 16, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createLiter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 17, status);
|
||||
return MeasureUnit::create(18, 17, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMegaliter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 18, status);
|
||||
return MeasureUnit::create(18, 18, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMilliliter(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 19, status);
|
||||
return MeasureUnit::create(18, 19, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createPint(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 20, status);
|
||||
return MeasureUnit::create(18, 20, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createPintMetric(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 21, status);
|
||||
return MeasureUnit::create(18, 21, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createQuart(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 22, status);
|
||||
return MeasureUnit::create(18, 22, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createTablespoon(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 23, status);
|
||||
return MeasureUnit::create(18, 23, status);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createTeaspoon(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 24, status);
|
||||
return MeasureUnit::create(18, 24, status);
|
||||
}
|
||||
|
||||
// End generated code
|
||||
|
@ -409,45 +409,13 @@ class U_I18N_API MeasureUnit: public UObject {
|
||||
static MeasureUnit *createMilePerGallonImperial(UErrorCode &status);
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
#ifndef U_HIDE_DRAFT_API
|
||||
/**
|
||||
* Returns unit of coordinate: east.
|
||||
* Caller owns returned value and must free it.
|
||||
* @param status ICU error code.
|
||||
* @draft ICU 58
|
||||
* @draft ICU 58, withdrawn
|
||||
* static MeasureUnit *createEast(UErrorCode &status);
|
||||
* static MeasureUnit *createNorth(UErrorCode &status);
|
||||
* static MeasureUnit *createSouth(UErrorCode &status);
|
||||
* static MeasureUnit *createWest(UErrorCode &status);
|
||||
*/
|
||||
static MeasureUnit *createEast(UErrorCode &status);
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
#ifndef U_HIDE_DRAFT_API
|
||||
/**
|
||||
* Returns unit of coordinate: north.
|
||||
* Caller owns returned value and must free it.
|
||||
* @param status ICU error code.
|
||||
* @draft ICU 58
|
||||
*/
|
||||
static MeasureUnit *createNorth(UErrorCode &status);
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
#ifndef U_HIDE_DRAFT_API
|
||||
/**
|
||||
* Returns unit of coordinate: south.
|
||||
* Caller owns returned value and must free it.
|
||||
* @param status ICU error code.
|
||||
* @draft ICU 58
|
||||
*/
|
||||
static MeasureUnit *createSouth(UErrorCode &status);
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
#ifndef U_HIDE_DRAFT_API
|
||||
/**
|
||||
* Returns unit of coordinate: west.
|
||||
* Caller owns returned value and must free it.
|
||||
* @param status ICU error code.
|
||||
* @draft ICU 58
|
||||
*/
|
||||
static MeasureUnit *createWest(UErrorCode &status);
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
/**
|
||||
* Returns unit of digital: bit.
|
||||
|
@ -47,6 +47,7 @@ private:
|
||||
void TestCompatible56_1();
|
||||
void TestCompatible57_1();
|
||||
void TestCompatible58_1();
|
||||
void TestCompatible59_1();
|
||||
void TestGetAvailable();
|
||||
void TestExamplesInDocs();
|
||||
void TestFormatPeriodEn();
|
||||
@ -143,6 +144,7 @@ void MeasureFormatTest::runIndexedTest(
|
||||
TESTCASE_AUTO(TestCompatible56_1);
|
||||
TESTCASE_AUTO(TestCompatible57_1);
|
||||
TESTCASE_AUTO(TestCompatible58_1);
|
||||
TESTCASE_AUTO(TestCompatible59_1);
|
||||
TESTCASE_AUTO(TestGetAvailable);
|
||||
TESTCASE_AUTO(TestExamplesInDocs);
|
||||
TESTCASE_AUTO(TestFormatPeriodEn);
|
||||
@ -777,10 +779,150 @@ void MeasureFormatTest::TestCompatible58_1() {
|
||||
measureUnit.adoptInstead(MeasureUnit::createLiterPerKilometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilePerGallon(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilePerGallonImperial(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createEast(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createNorth(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSouth(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createWest(status));
|
||||
// measureUnit.adoptInstead(MeasureUnit::createEast(status));
|
||||
// measureUnit.adoptInstead(MeasureUnit::createNorth(status));
|
||||
// measureUnit.adoptInstead(MeasureUnit::createSouth(status));
|
||||
// measureUnit.adoptInstead(MeasureUnit::createWest(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createBit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createByte(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGigabit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGigabyte(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilobit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilobyte(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMegabit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMegabyte(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createTerabit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createTerabyte(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCentury(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createDay(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createHour(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMicrosecond(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMillisecond(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMinute(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMonth(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createNanosecond(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSecond(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createWeek(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createYear(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createAmpere(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilliampere(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createOhm(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createVolt(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCalorie(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createFoodcalorie(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createJoule(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilocalorie(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilojoule(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilowattHour(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGigahertz(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createHertz(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilohertz(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMegahertz(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createAstronomicalUnit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCentimeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createDecimeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createFathom(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createFoot(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createFurlong(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createInch(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createLightYear(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMicrometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMile(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMileScandinavian(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMillimeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createNanometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createNauticalMile(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createParsec(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createPicometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createYard(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createLux(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCarat(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGram(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilogram(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMetricTon(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMicrogram(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilligram(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createOunce(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createOunceTroy(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createPound(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createStone(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createTon(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGigawatt(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createHorsepower(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilowatt(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMegawatt(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilliwatt(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createWatt(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createHectopascal(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createInchHg(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMillibar(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMillimeterOfMercury(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createPoundPerSquareInch(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKilometerPerHour(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKnot(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMeterPerSecond(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilePerHour(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCelsius(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createFahrenheit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGenericTemperature(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKelvin(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createAcreFoot(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createBushel(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCentiliter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCubicCentimeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCubicFoot(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCubicInch(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCubicKilometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCubicMeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCubicMile(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCubicYard(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCup(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createCupMetric(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createDeciliter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createFluidOunce(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGallon(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGallonImperial(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createHectoliter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createLiter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMegaliter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilliliter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createPint(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createPintMetric(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createQuart(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createTablespoon(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createTeaspoon(status));
|
||||
assertSuccess("", status);
|
||||
}
|
||||
|
||||
void MeasureFormatTest::TestCompatible59_1() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
LocalPointer<MeasureUnit> measureUnit;
|
||||
measureUnit.adoptInstead(MeasureUnit::createGForce(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMeterPerSecondSquared(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createArcMinute(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createArcSecond(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createDegree(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createRadian(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createRevolutionAngle(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createAcre(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createHectare(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSquareCentimeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSquareFoot(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSquareInch(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSquareKilometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSquareMeter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSquareMile(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createSquareYard(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createKarat(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilligramPerDeciliter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMillimolePerLiter(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createPartPerMillion(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createLiterPer100Kilometers(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createLiterPerKilometer(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilePerGallon(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createMilePerGallonImperial(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createBit(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createByte(status));
|
||||
measureUnit.adoptInstead(MeasureUnit::createGigabit(status));
|
||||
|
@ -834,10 +834,8 @@ public class MeasureFormat extends UFormat {
|
||||
// Trigger a fresh lookup of the patterns for this unit+width.
|
||||
patterns = null;
|
||||
|
||||
if (value.getType() == ICUResourceBundle.STRING) {
|
||||
// Units like "coordinate" that don't have plural variants
|
||||
setFormatterIfAbsent(StandardPlural.OTHER.ordinal(), value, 0);
|
||||
} else if (value.getType() == ICUResourceBundle.TABLE) {
|
||||
// We no longer handle units like "coordinate" here (which do not have plural variants)
|
||||
if (value.getType() == ICUResourceBundle.TABLE) {
|
||||
// Units that have plural variants
|
||||
UResource.Table patternTableTable = value.getTable();
|
||||
for (int i = 0; patternTableTable.getKeyAndValue(i, key, value); i++) {
|
||||
@ -875,6 +873,8 @@ public class MeasureFormat extends UFormat {
|
||||
consumeCompoundPattern(key, value);
|
||||
}
|
||||
}
|
||||
} else if (key.contentEquals("coordinate")) {
|
||||
// special handling but we need to determine what that is
|
||||
} else {
|
||||
type = key.toString();
|
||||
UResource.Table subtypeTable = value.getTable();
|
||||
|
@ -257,8 +257,8 @@ public class MeasureUnit implements Serializable {
|
||||
public void put(UResource.Key key, UResource.Value value, boolean noFallback) {
|
||||
UResource.Table unitTypesTable = value.getTable();
|
||||
for (int i2 = 0; unitTypesTable.getKeyAndValue(i2, key, value); ++i2) {
|
||||
// Skip "compound" since it is treated differently from the other units
|
||||
if (key.contentEquals("compound")) {
|
||||
// Skip "compound" and "coordinate" since they are treated differently from the other units
|
||||
if (key.contentEquals("compound") || key.contentEquals("coordinate")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -511,32 +511,12 @@ public class MeasureUnit implements Serializable {
|
||||
public static final MeasureUnit MILE_PER_GALLON_IMPERIAL = MeasureUnit.internalGetInstance("consumption", "mile-per-gallon-imperial");
|
||||
|
||||
/**
|
||||
* Constant for unit of coordinate: east
|
||||
* @draft ICU 58
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @draft ICU 58, withdrawn
|
||||
* public static final MeasureUnit EAST = MeasureUnit.internalGetInstance("coordinate", "east");
|
||||
* public static final MeasureUnit NORTH = MeasureUnit.internalGetInstance("coordinate", "north");
|
||||
* public static final MeasureUnit SOUTH = MeasureUnit.internalGetInstance("coordinate", "south");
|
||||
* public static final MeasureUnit WEST = MeasureUnit.internalGetInstance("coordinate", "west");
|
||||
*/
|
||||
public static final MeasureUnit EAST = MeasureUnit.internalGetInstance("coordinate", "east");
|
||||
|
||||
/**
|
||||
* Constant for unit of coordinate: north
|
||||
* @draft ICU 58
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
*/
|
||||
public static final MeasureUnit NORTH = MeasureUnit.internalGetInstance("coordinate", "north");
|
||||
|
||||
/**
|
||||
* Constant for unit of coordinate: south
|
||||
* @draft ICU 58
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
*/
|
||||
public static final MeasureUnit SOUTH = MeasureUnit.internalGetInstance("coordinate", "south");
|
||||
|
||||
/**
|
||||
* Constant for unit of coordinate: west
|
||||
* @draft ICU 58
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
*/
|
||||
public static final MeasureUnit WEST = MeasureUnit.internalGetInstance("coordinate", "west");
|
||||
|
||||
/**
|
||||
* Constant for unit of digital: bit
|
||||
|
@ -215,10 +215,10 @@ public class MeasureUnitTest extends TestFmwk {
|
||||
{"PART_PER_MILLION", "57"},
|
||||
{"MILE_PER_GALLON_IMPERIAL", "57"},
|
||||
{"GALLON_IMPERIAL", "57"},
|
||||
{"EAST", "58"},
|
||||
{"NORTH", "58"},
|
||||
{"SOUTH", "58"},
|
||||
{"WEST", "58"},
|
||||
// {"EAST", "58"},
|
||||
// {"NORTH", "58"},
|
||||
// {"SOUTH", "58"},
|
||||
// {"WEST", "58"},
|
||||
};
|
||||
|
||||
private static final HashMap<String, String> JAVA_VERSION_MAP = new HashMap<String, String>();
|
||||
@ -273,12 +273,12 @@ public class MeasureUnitTest extends TestFmwk {
|
||||
// various generateXXX calls go here, see
|
||||
// http://site.icu-project.org/design/formatting/measureformat/updating-measure-unit
|
||||
// use this test to run each of the ollowing in succession
|
||||
//generateConstants("58"); // for MeasureUnit.java, update generated MeasureUnit constants
|
||||
//generateBackwardCompatibilityTest("58.1"); // for MeasureUnitTest.java, create TestCompatible58_1
|
||||
//generateCXXHConstants("58"); // for measunit.h, update generated createXXX methods
|
||||
//generateConstants("59"); // for MeasureUnit.java, update generated MeasureUnit constants
|
||||
//generateBackwardCompatibilityTest("59.1"); // for MeasureUnitTest.java, create TestCompatible58_1
|
||||
//generateCXXHConstants("59"); // for measunit.h, update generated createXXX methods
|
||||
//generateCXXConstants(); // for measunit.cpp, update generated code
|
||||
//generateCXXBackwardCompatibilityTest("58.1"); // for measfmttest.cpp, create TestCompatible58_1
|
||||
updateJAVAVersions("58"); // for MeasureUnitTest.java, JAVA_VERSIONS
|
||||
//generateCXXBackwardCompatibilityTest("59.1"); // for measfmttest.cpp, create TestCompatible58_1
|
||||
//updateJAVAVersions("59"); // for MeasureUnitTest.java, JAVA_VERSIONS
|
||||
}
|
||||
*/
|
||||
|
||||
@ -896,10 +896,10 @@ public class MeasureUnitTest extends TestFmwk {
|
||||
MeasureUnit.LITER_PER_KILOMETER,
|
||||
MeasureUnit.MILE_PER_GALLON,
|
||||
MeasureUnit.MILE_PER_GALLON_IMPERIAL,
|
||||
MeasureUnit.EAST,
|
||||
MeasureUnit.NORTH,
|
||||
MeasureUnit.SOUTH,
|
||||
MeasureUnit.WEST,
|
||||
// MeasureUnit.EAST,
|
||||
// MeasureUnit.NORTH,
|
||||
// MeasureUnit.SOUTH,
|
||||
// MeasureUnit.WEST,
|
||||
MeasureUnit.BIT,
|
||||
MeasureUnit.BYTE,
|
||||
MeasureUnit.GIGABIT,
|
||||
@ -1011,7 +1011,148 @@ public class MeasureUnitTest extends TestFmwk {
|
||||
MeasureUnit.TABLESPOON,
|
||||
MeasureUnit.TEASPOON,
|
||||
};
|
||||
assertEquals("", 138, units.length);
|
||||
assertEquals("", 134, units.length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestCompatible59_1() {
|
||||
MeasureUnit[] units = {
|
||||
MeasureUnit.G_FORCE,
|
||||
MeasureUnit.METER_PER_SECOND_SQUARED,
|
||||
MeasureUnit.ARC_MINUTE,
|
||||
MeasureUnit.ARC_SECOND,
|
||||
MeasureUnit.DEGREE,
|
||||
MeasureUnit.RADIAN,
|
||||
MeasureUnit.REVOLUTION_ANGLE,
|
||||
MeasureUnit.ACRE,
|
||||
MeasureUnit.HECTARE,
|
||||
MeasureUnit.SQUARE_CENTIMETER,
|
||||
MeasureUnit.SQUARE_FOOT,
|
||||
MeasureUnit.SQUARE_INCH,
|
||||
MeasureUnit.SQUARE_KILOMETER,
|
||||
MeasureUnit.SQUARE_METER,
|
||||
MeasureUnit.SQUARE_MILE,
|
||||
MeasureUnit.SQUARE_YARD,
|
||||
MeasureUnit.KARAT,
|
||||
MeasureUnit.MILLIGRAM_PER_DECILITER,
|
||||
MeasureUnit.MILLIMOLE_PER_LITER,
|
||||
MeasureUnit.PART_PER_MILLION,
|
||||
MeasureUnit.LITER_PER_100KILOMETERS,
|
||||
MeasureUnit.LITER_PER_KILOMETER,
|
||||
MeasureUnit.MILE_PER_GALLON,
|
||||
MeasureUnit.MILE_PER_GALLON_IMPERIAL,
|
||||
MeasureUnit.BIT,
|
||||
MeasureUnit.BYTE,
|
||||
MeasureUnit.GIGABIT,
|
||||
MeasureUnit.GIGABYTE,
|
||||
MeasureUnit.KILOBIT,
|
||||
MeasureUnit.KILOBYTE,
|
||||
MeasureUnit.MEGABIT,
|
||||
MeasureUnit.MEGABYTE,
|
||||
MeasureUnit.TERABIT,
|
||||
MeasureUnit.TERABYTE,
|
||||
MeasureUnit.CENTURY,
|
||||
MeasureUnit.DAY,
|
||||
MeasureUnit.HOUR,
|
||||
MeasureUnit.MICROSECOND,
|
||||
MeasureUnit.MILLISECOND,
|
||||
MeasureUnit.MINUTE,
|
||||
MeasureUnit.MONTH,
|
||||
MeasureUnit.NANOSECOND,
|
||||
MeasureUnit.SECOND,
|
||||
MeasureUnit.WEEK,
|
||||
MeasureUnit.YEAR,
|
||||
MeasureUnit.AMPERE,
|
||||
MeasureUnit.MILLIAMPERE,
|
||||
MeasureUnit.OHM,
|
||||
MeasureUnit.VOLT,
|
||||
MeasureUnit.CALORIE,
|
||||
MeasureUnit.FOODCALORIE,
|
||||
MeasureUnit.JOULE,
|
||||
MeasureUnit.KILOCALORIE,
|
||||
MeasureUnit.KILOJOULE,
|
||||
MeasureUnit.KILOWATT_HOUR,
|
||||
MeasureUnit.GIGAHERTZ,
|
||||
MeasureUnit.HERTZ,
|
||||
MeasureUnit.KILOHERTZ,
|
||||
MeasureUnit.MEGAHERTZ,
|
||||
MeasureUnit.ASTRONOMICAL_UNIT,
|
||||
MeasureUnit.CENTIMETER,
|
||||
MeasureUnit.DECIMETER,
|
||||
MeasureUnit.FATHOM,
|
||||
MeasureUnit.FOOT,
|
||||
MeasureUnit.FURLONG,
|
||||
MeasureUnit.INCH,
|
||||
MeasureUnit.KILOMETER,
|
||||
MeasureUnit.LIGHT_YEAR,
|
||||
MeasureUnit.METER,
|
||||
MeasureUnit.MICROMETER,
|
||||
MeasureUnit.MILE,
|
||||
MeasureUnit.MILE_SCANDINAVIAN,
|
||||
MeasureUnit.MILLIMETER,
|
||||
MeasureUnit.NANOMETER,
|
||||
MeasureUnit.NAUTICAL_MILE,
|
||||
MeasureUnit.PARSEC,
|
||||
MeasureUnit.PICOMETER,
|
||||
MeasureUnit.YARD,
|
||||
MeasureUnit.LUX,
|
||||
MeasureUnit.CARAT,
|
||||
MeasureUnit.GRAM,
|
||||
MeasureUnit.KILOGRAM,
|
||||
MeasureUnit.METRIC_TON,
|
||||
MeasureUnit.MICROGRAM,
|
||||
MeasureUnit.MILLIGRAM,
|
||||
MeasureUnit.OUNCE,
|
||||
MeasureUnit.OUNCE_TROY,
|
||||
MeasureUnit.POUND,
|
||||
MeasureUnit.STONE,
|
||||
MeasureUnit.TON,
|
||||
MeasureUnit.GIGAWATT,
|
||||
MeasureUnit.HORSEPOWER,
|
||||
MeasureUnit.KILOWATT,
|
||||
MeasureUnit.MEGAWATT,
|
||||
MeasureUnit.MILLIWATT,
|
||||
MeasureUnit.WATT,
|
||||
MeasureUnit.HECTOPASCAL,
|
||||
MeasureUnit.INCH_HG,
|
||||
MeasureUnit.MILLIBAR,
|
||||
MeasureUnit.MILLIMETER_OF_MERCURY,
|
||||
MeasureUnit.POUND_PER_SQUARE_INCH,
|
||||
MeasureUnit.KILOMETER_PER_HOUR,
|
||||
MeasureUnit.KNOT,
|
||||
MeasureUnit.METER_PER_SECOND,
|
||||
MeasureUnit.MILE_PER_HOUR,
|
||||
MeasureUnit.CELSIUS,
|
||||
MeasureUnit.FAHRENHEIT,
|
||||
MeasureUnit.GENERIC_TEMPERATURE,
|
||||
MeasureUnit.KELVIN,
|
||||
MeasureUnit.ACRE_FOOT,
|
||||
MeasureUnit.BUSHEL,
|
||||
MeasureUnit.CENTILITER,
|
||||
MeasureUnit.CUBIC_CENTIMETER,
|
||||
MeasureUnit.CUBIC_FOOT,
|
||||
MeasureUnit.CUBIC_INCH,
|
||||
MeasureUnit.CUBIC_KILOMETER,
|
||||
MeasureUnit.CUBIC_METER,
|
||||
MeasureUnit.CUBIC_MILE,
|
||||
MeasureUnit.CUBIC_YARD,
|
||||
MeasureUnit.CUP,
|
||||
MeasureUnit.CUP_METRIC,
|
||||
MeasureUnit.DECILITER,
|
||||
MeasureUnit.FLUID_OUNCE,
|
||||
MeasureUnit.GALLON,
|
||||
MeasureUnit.GALLON_IMPERIAL,
|
||||
MeasureUnit.HECTOLITER,
|
||||
MeasureUnit.LITER,
|
||||
MeasureUnit.MEGALITER,
|
||||
MeasureUnit.MILLILITER,
|
||||
MeasureUnit.PINT,
|
||||
MeasureUnit.PINT_METRIC,
|
||||
MeasureUnit.QUART,
|
||||
MeasureUnit.TABLESPOON,
|
||||
MeasureUnit.TEASPOON,
|
||||
};
|
||||
assertEquals("", 134, units.length);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -1881,7 +2022,7 @@ public class MeasureUnitTest extends TestFmwk {
|
||||
}
|
||||
}
|
||||
for (String type : MeasureUnit.getAvailableTypes()) {
|
||||
if (type.equals("currency") || type.equals("compound")) {
|
||||
if (type.equals("currency") || type.equals("compound") || type.equals("coordinate")) {
|
||||
continue;
|
||||
}
|
||||
for (MeasureUnit unit : MeasureUnit.getAvailable(type)) {
|
||||
|
Loading…
Reference in New Issue
Block a user