private static final long serialVersionUID = 4716293295276629682L;
- private static final int POSITIVE_PREFIX = 0, POSITIVE_SUFFIX = 1, AFFIX_SIZE = 2;
+// private static final int POSITIVE_PREFIX = 0, POSITIVE_SUFFIX = 1, AFFIX_SIZE = 2;
private static final CompactDecimalDataCache cache = new CompactDecimalDataCache();
private final Map<String, DecimalFormat.Unit[]> units;
* overridden by default.
* @param formatSymbols
* Decimal format symbols, typically from a locale.
- * @param prefix
- * An array of prefix values, one for each power of 10 from 0 to 14
- * @param suffix
- * An array of prefix values, one for each power of 10 from 0 to 14
+ * @param style
+ * compact style.
* @param divisor
* An array of prefix values, one for each power of 10 from 0 to 14
+ * @param pluralAffixes
+ * A map from plural categories to affixes.
+ * @param currencyAffixes
+ * A map from plural categories to currency affixes.
* @param debugCreationErrors
* A collection of strings for debugging. If null on input, then any errors found will be added to that
* collection instead of throwing exceptions.
/**
* Return the NumberInfo for the number, given this formatter's settings.
- * @param number
- * @return
+ * @param number The number.
+ * @return The NumberInfo for the given number.
* @internal
- * @deprecated
+ * @deprecated This API is ICU internal only.
*/
public NumberInfo getNumberInfo(double number) {
if (getMaximumFractionDigits() == 0 && !areSignificantDigitsUsed()) {
/**
* Returns the locale of this object.
- * @deprecated
* @internal
+ * @deprecated This API is ICU internal only.
*/
public ULocale getLocale() {
return locale;
/**
* Utility for getting CARDINAL rules.
- * @param locale
+ * @param locale the locale
* @return plural rules.
* @deprecated This API is ICU internal only.
* @internal
return 37;
}
+ @SuppressWarnings("unused")
private boolean addConditional(Set<NumberInfo> toAddTo, Set<NumberInfo> others, double trial) {
boolean added;
NumberInfo toAdd = new NumberInfo(trial);
/**
- * Given a number, returns the keyword of the first rule that applies to
+ * Given a number information, returns the keyword of the first rule that applies to
* the number.
*
- * @param number The number for which the rule has to be determined.
+ * @param sample The number information for which the rule has to be determined.
* @return The keyword of the selected rule.
* @internal
* @deprecated This API is ICU internal only.
throws IOException {
throw new NotSerializableException();
}
+
private void readObject(ObjectInputStream in
) throws IOException, ClassNotFoundException {
throw new NotSerializableException();
}
- private void readObjectNoData(
- ) throws ObjectStreamException {
- throw new NotSerializableException();
- }
+
private Object writeReplace() throws ObjectStreamException {
return new PluralRulesSerialProxy(toString());
}
this.currencyString = currencyString;
}
- private String getISOCode() {
+ public String getISOCode() {
return isoCode;
}
- private String getCurrencyString() {
+ @SuppressWarnings("unused")
+ public String getCurrencyString() {
return currencyString;
}
}
public void TestT9968() {
SimpleDateFormat sdf0 = new SimpleDateFormat("-MMMM");
ParsePosition pos0 = new ParsePosition(0);
- Date d0 = sdf0.parse("-September", pos0);
- logln("sdf0: "+pos0.getErrorIndex() + "/" + pos0.getIndex());
+ /* Date d0 = */ sdf0.parse("-September", pos0);
+ logln("sdf0: " + pos0.getErrorIndex() + "/" + pos0.getIndex());
assertTrue("Fail: failed a good test", pos0.getErrorIndex() == -1);
SimpleDateFormat sdf1 = new SimpleDateFormat("-MMMM");
ParsePosition pos1 = new ParsePosition(0);
- Date d1 = sdf1.parse("-????", pos1);
- logln("sdf1: "+pos1.getErrorIndex() + "/" + pos1.getIndex());
+ /* Date d1 = */ sdf1.parse("-????", pos1);
+ logln("sdf1: " + pos1.getErrorIndex() + "/" + pos1.getIndex());
assertTrue("Fail: failed to detect bad parse", pos1.getErrorIndex() == 1);
SimpleDateFormat sdf2 = new SimpleDateFormat("MMMM");
ParsePosition pos2 = new ParsePosition(0);
- Date d2 = sdf2.parse("????", pos2);
- logln("sdf2: "+pos2.getErrorIndex() + "/" + pos2.getIndex());
+ /* Date d2 = */ sdf2.parse("????", pos2);
+ logln("sdf2: " + pos2.getErrorIndex() + "/" + pos2.getIndex());
assertTrue("Fail: failed to detect bad parse", pos2.getErrorIndex() == 0);
-
- }
+ }
}
//eof
public void TestT10110() {
try {
- SimpleDateFormat formatter = new SimpleDateFormat("Gy年M月d日E", new Locale("zh_Hans"));
- Object parsed = formatter.parseObject("610000");
+ SimpleDateFormat formatter = new SimpleDateFormat("Gy年M月d日E", new Locale("zh_Hans"));
+ /* Object parsed = */ formatter.parseObject("610000");
}
catch(ParseException pe) {
return;
}
catch(Throwable t) {
- errln("ParseException not thrown for bad pattern! exception was: " + t.getLocalizedMessage());
- return;
+ errln("ParseException not thrown for bad pattern! exception was: " + t.getLocalizedMessage());
+ return;
}
errln("No exception thrown at all for bad pattern!");
}
for (NumberInfo sample : samples) {
collisionTest.clear();
for (Entry<String, PluralRules> entry: keywordToRule.entrySet()) {
- String keyword = entry.getKey();
PluralRules rule = entry.getValue();
String foundKeyword = rule.select(sample);
if (foundKeyword.equals("other")) {
logln(locale + "\tsize:\t" + size.value);
max = Math.max(max, size.value);
if (!assertEquals(locale + "\tPlural rules before and after serialization", item, item2)) {
+ // for debugging
PluralRules item3 = serializeAndDeserialize(item, size);
- item.equals(item2);
+ item.equals(item3);
}
}
logln("max \tsize:\t" + max);