choicfmt.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. // Copyright (C) 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. ********************************************************************************
  5. * Copyright (C) 1997-2013, International Business Machines
  6. * Corporation and others. All Rights Reserved.
  7. ********************************************************************************
  8. *
  9. * File CHOICFMT.H
  10. *
  11. * Modification History:
  12. *
  13. * Date Name Description
  14. * 02/19/97 aliu Converted from java.
  15. * 03/20/97 helena Finished first cut of implementation and got rid
  16. * of nextDouble/previousDouble and replaced with
  17. * boolean array.
  18. * 4/10/97 aliu Clean up. Modified to work on AIX.
  19. * 8/6/97 nos Removed overloaded constructor, member var 'buffer'.
  20. * 07/22/98 stephen Removed operator!= (implemented in Format)
  21. ********************************************************************************
  22. */
  23. #ifndef CHOICFMT_H
  24. #define CHOICFMT_H
  25. #include "unicode/utypes.h"
  26. /**
  27. * \file
  28. * \brief C++ API: Choice Format.
  29. */
  30. #if !UCONFIG_NO_FORMATTING
  31. #ifndef U_HIDE_DEPRECATED_API
  32. #include "unicode/fieldpos.h"
  33. #include "unicode/format.h"
  34. #include "unicode/messagepattern.h"
  35. #include "unicode/numfmt.h"
  36. #include "unicode/unistr.h"
  37. U_NAMESPACE_BEGIN
  38. class MessageFormat;
  39. /**
  40. * ChoiceFormat converts between ranges of numeric values and strings for those ranges.
  41. * The strings must conform to the MessageFormat pattern syntax.
  42. *
  43. * <p><em><code>ChoiceFormat</code> is probably not what you need.
  44. * Please use <code>MessageFormat</code>
  45. * with <code>plural</code> arguments for proper plural selection,
  46. * and <code>select</code> arguments for simple selection among a fixed set of choices!</em></p>
  47. *
  48. * <p>A <code>ChoiceFormat</code> splits
  49. * the real number line \htmlonly<code>-&#x221E;</code> to
  50. * <code>+&#x221E;</code>\endhtmlonly into two
  51. * or more contiguous ranges. Each range is mapped to a
  52. * string.</p>
  53. *
  54. * <p><code>ChoiceFormat</code> was originally intended
  55. * for displaying grammatically correct
  56. * plurals such as &quot;There is one file.&quot; vs. &quot;There are 2 files.&quot;
  57. * <em>However,</em> plural rules for many languages
  58. * are too complex for the capabilities of ChoiceFormat,
  59. * and its requirement of specifying the precise rules for each message
  60. * is unmanageable for translators.</p>
  61. *
  62. * <p>There are two methods of defining a <code>ChoiceFormat</code>; both
  63. * are equivalent. The first is by using a string pattern. This is the
  64. * preferred method in most cases. The second method is through direct
  65. * specification of the arrays that logically make up the
  66. * <code>ChoiceFormat</code>.</p>
  67. *
  68. * <p>Note: Typically, choice formatting is done (if done at all) via <code>MessageFormat</code>
  69. * with a <code>choice</code> argument type,
  70. * rather than using a stand-alone <code>ChoiceFormat</code>.</p>
  71. *
  72. * <h5>Patterns and Their Interpretation</h5>
  73. *
  74. * <p>The pattern string defines the range boundaries and the strings for each number range.
  75. * Syntax:
  76. * <pre>
  77. * choiceStyle = number separator message ('|' number separator message)*
  78. * number = normal_number | ['-'] \htmlonly&#x221E;\endhtmlonly (U+221E, infinity)
  79. * normal_number = double value (unlocalized ASCII string)
  80. * separator = less_than | less_than_or_equal
  81. * less_than = '<'
  82. * less_than_or_equal = '#' | \htmlonly&#x2264;\endhtmlonly (U+2264)
  83. * message: see {@link MessageFormat}
  84. * </pre>
  85. * Pattern_White_Space between syntax elements is ignored, except
  86. * around each range's sub-message.</p>
  87. *
  88. * <p>Each numeric sub-range extends from the current range's number
  89. * to the next range's number.
  90. * The number itself is included in its range if a <code>less_than_or_equal</code> sign is used,
  91. * and excluded from its range (and instead included in the previous range)
  92. * if a <code>less_than</code> sign is used.</p>
  93. *
  94. * <p>When a <code>ChoiceFormat</code> is constructed from
  95. * arrays of numbers, closure flags and strings,
  96. * they are interpreted just like
  97. * the sequence of <code>(number separator string)</code> in an equivalent pattern string.
  98. * <code>closure[i]==TRUE</code> corresponds to a <code>less_than</code> separator sign.
  99. * The equivalent pattern string will be constructed automatically.</p>
  100. *
  101. * <p>During formatting, a number is mapped to the first range
  102. * where the number is not greater than the range's upper limit.
  103. * That range's message string is returned. A NaN maps to the very first range.</p>
  104. *
  105. * <p>During parsing, a range is selected for the longest match of
  106. * any range's message. That range's number is returned, ignoring the separator/closure.
  107. * Only a simple string match is performed, without parsing of arguments that
  108. * might be specified in the message strings.</p>
  109. *
  110. * <p>Note that the first range's number is ignored in formatting
  111. * but may be returned from parsing.</p>
  112. *
  113. * <h5>Examples</h5>
  114. *
  115. * <p>Here is an example of two arrays that map the number
  116. * <code>1..7</code> to the English day of the week abbreviations
  117. * <code>Sun..Sat</code>. No closures array is given; this is the same as
  118. * specifying all closures to be <code>FALSE</code>.</p>
  119. *
  120. * <pre> {1,2,3,4,5,6,7},
  121. * {&quot;Sun&quot;,&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thur&quot;,&quot;Fri&quot;,&quot;Sat&quot;}</pre>
  122. *
  123. * <p>Here is an example that maps the ranges [-Inf, 1), [1, 1], and (1,
  124. * +Inf] to three strings. That is, the number line is split into three
  125. * ranges: x &lt; 1.0, x = 1.0, and x &gt; 1.0.
  126. * (The round parentheses in the notation above indicate an exclusive boundary,
  127. * like the turned bracket in European notation: [-Inf, 1) == [-Inf, 1[ )</p>
  128. *
  129. * <pre> {0, 1, 1},
  130. * {FALSE, FALSE, TRUE},
  131. * {&quot;no files&quot;, &quot;one file&quot;, &quot;many files&quot;}</pre>
  132. *
  133. * <p>Here is an example that shows formatting and parsing: </p>
  134. *
  135. * \code
  136. * #include <unicode/choicfmt.h>
  137. * #include <unicode/unistr.h>
  138. * #include <iostream.h>
  139. *
  140. * int main(int argc, char *argv[]) {
  141. * double limits[] = {1,2,3,4,5,6,7};
  142. * UnicodeString monthNames[] = {
  143. * "Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
  144. * ChoiceFormat fmt(limits, monthNames, 7);
  145. * UnicodeString str;
  146. * char buf[256];
  147. * for (double x = 1.0; x <= 8.0; x += 1.0) {
  148. * fmt.format(x, str);
  149. * str.extract(0, str.length(), buf, 256, "");
  150. * str.truncate(0);
  151. * cout << x << " -> "
  152. * << buf << endl;
  153. * }
  154. * cout << endl;
  155. * return 0;
  156. * }
  157. * \endcode
  158. *
  159. * <p><em>User subclasses are not supported.</em> While clients may write
  160. * subclasses, such code will not necessarily work and will not be
  161. * guaranteed to work stably from release to release.
  162. *
  163. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  164. */
  165. class U_I18N_API ChoiceFormat: public NumberFormat {
  166. public:
  167. /**
  168. * Constructs a new ChoiceFormat from the pattern string.
  169. *
  170. * @param pattern Pattern used to construct object.
  171. * @param status Output param to receive success code. If the
  172. * pattern cannot be parsed, set to failure code.
  173. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  174. */
  175. ChoiceFormat(const UnicodeString& pattern,
  176. UErrorCode& status);
  177. /**
  178. * Constructs a new ChoiceFormat with the given limits and message strings.
  179. * All closure flags default to <code>FALSE</code>,
  180. * equivalent to <code>less_than_or_equal</code> separators.
  181. *
  182. * Copies the limits and formats instead of adopting them.
  183. *
  184. * @param limits Array of limit values.
  185. * @param formats Array of formats.
  186. * @param count Size of 'limits' and 'formats' arrays.
  187. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  188. */
  189. ChoiceFormat(const double* limits,
  190. const UnicodeString* formats,
  191. int32_t count );
  192. /**
  193. * Constructs a new ChoiceFormat with the given limits, closure flags and message strings.
  194. *
  195. * Copies the limits and formats instead of adopting them.
  196. *
  197. * @param limits Array of limit values
  198. * @param closures Array of booleans specifying whether each
  199. * element of 'limits' is open or closed. If FALSE, then the
  200. * corresponding limit number is a member of its range.
  201. * If TRUE, then the limit number belongs to the previous range it.
  202. * @param formats Array of formats
  203. * @param count Size of 'limits', 'closures', and 'formats' arrays
  204. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  205. */
  206. ChoiceFormat(const double* limits,
  207. const UBool* closures,
  208. const UnicodeString* formats,
  209. int32_t count);
  210. /**
  211. * Copy constructor.
  212. *
  213. * @param that ChoiceFormat object to be copied from
  214. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  215. */
  216. ChoiceFormat(const ChoiceFormat& that);
  217. /**
  218. * Assignment operator.
  219. *
  220. * @param that ChoiceFormat object to be copied
  221. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  222. */
  223. const ChoiceFormat& operator=(const ChoiceFormat& that);
  224. /**
  225. * Destructor.
  226. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  227. */
  228. virtual ~ChoiceFormat();
  229. /**
  230. * Clones this Format object. The caller owns the
  231. * result and must delete it when done.
  232. *
  233. * @return a copy of this object
  234. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  235. */
  236. virtual Format* clone(void) const;
  237. /**
  238. * Returns true if the given Format objects are semantically equal.
  239. * Objects of different subclasses are considered unequal.
  240. *
  241. * @param other ChoiceFormat object to be compared
  242. * @return true if other is the same as this.
  243. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  244. */
  245. virtual UBool operator==(const Format& other) const;
  246. /**
  247. * Sets the pattern.
  248. * @param pattern The pattern to be applied.
  249. * @param status Output param set to success/failure code on
  250. * exit. If the pattern is invalid, this will be
  251. * set to a failure result.
  252. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  253. */
  254. virtual void applyPattern(const UnicodeString& pattern,
  255. UErrorCode& status);
  256. /**
  257. * Sets the pattern.
  258. * @param pattern The pattern to be applied.
  259. * @param parseError Struct to receive information on position
  260. * of error if an error is encountered
  261. * @param status Output param set to success/failure code on
  262. * exit. If the pattern is invalid, this will be
  263. * set to a failure result.
  264. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  265. */
  266. virtual void applyPattern(const UnicodeString& pattern,
  267. UParseError& parseError,
  268. UErrorCode& status);
  269. /**
  270. * Gets the pattern.
  271. *
  272. * @param pattern Output param which will receive the pattern
  273. * Previous contents are deleted.
  274. * @return A reference to 'pattern'
  275. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  276. */
  277. virtual UnicodeString& toPattern(UnicodeString &pattern) const;
  278. /**
  279. * Sets the choices to be used in formatting.
  280. * For details see the constructor with the same parameter list.
  281. *
  282. * @param limitsToCopy Contains the top value that you want
  283. * parsed with that format,and should be in
  284. * ascending sorted order. When formatting X,
  285. * the choice will be the i, where limit[i]
  286. * &lt;= X &lt; limit[i+1].
  287. * @param formatsToCopy The format strings you want to use for each limit.
  288. * @param count The size of the above arrays.
  289. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  290. */
  291. virtual void setChoices(const double* limitsToCopy,
  292. const UnicodeString* formatsToCopy,
  293. int32_t count );
  294. /**
  295. * Sets the choices to be used in formatting.
  296. * For details see the constructor with the same parameter list.
  297. *
  298. * @param limits Array of limits
  299. * @param closures Array of limit booleans
  300. * @param formats Array of format string
  301. * @param count The size of the above arrays
  302. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  303. */
  304. virtual void setChoices(const double* limits,
  305. const UBool* closures,
  306. const UnicodeString* formats,
  307. int32_t count);
  308. /**
  309. * Returns NULL and 0.
  310. * Before ICU 4.8, this used to return the choice limits array.
  311. *
  312. * @param count Will be set to 0.
  313. * @return NULL
  314. * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern.
  315. */
  316. virtual const double* getLimits(int32_t& count) const;
  317. /**
  318. * Returns NULL and 0.
  319. * Before ICU 4.8, this used to return the limit booleans array.
  320. *
  321. * @param count Will be set to 0.
  322. * @return NULL
  323. * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern.
  324. */
  325. virtual const UBool* getClosures(int32_t& count) const;
  326. /**
  327. * Returns NULL and 0.
  328. * Before ICU 4.8, this used to return the array of choice strings.
  329. *
  330. * @param count Will be set to 0.
  331. * @return NULL
  332. * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern.
  333. */
  334. virtual const UnicodeString* getFormats(int32_t& count) const;
  335. using NumberFormat::format;
  336. /**
  337. * Formats a double number using this object's choices.
  338. *
  339. * @param number The value to be formatted.
  340. * @param appendTo Output parameter to receive result.
  341. * Result is appended to existing contents.
  342. * @param pos On input: an alignment field, if desired.
  343. * On output: the offsets of the alignment field.
  344. * @return Reference to 'appendTo' parameter.
  345. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  346. */
  347. virtual UnicodeString& format(double number,
  348. UnicodeString& appendTo,
  349. FieldPosition& pos) const;
  350. /**
  351. * Formats an int32_t number using this object's choices.
  352. *
  353. * @param number The value to be formatted.
  354. * @param appendTo Output parameter to receive result.
  355. * Result is appended to existing contents.
  356. * @param pos On input: an alignment field, if desired.
  357. * On output: the offsets of the alignment field.
  358. * @return Reference to 'appendTo' parameter.
  359. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  360. */
  361. virtual UnicodeString& format(int32_t number,
  362. UnicodeString& appendTo,
  363. FieldPosition& pos) const;
  364. /**
  365. * Formats an int64_t number using this object's choices.
  366. *
  367. * @param number The value to be formatted.
  368. * @param appendTo Output parameter to receive result.
  369. * Result is appended to existing contents.
  370. * @param pos On input: an alignment field, if desired.
  371. * On output: the offsets of the alignment field.
  372. * @return Reference to 'appendTo' parameter.
  373. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  374. */
  375. virtual UnicodeString& format(int64_t number,
  376. UnicodeString& appendTo,
  377. FieldPosition& pos) const;
  378. /**
  379. * Formats an array of objects using this object's choices.
  380. *
  381. * @param objs The array of objects to be formatted.
  382. * @param cnt The size of objs.
  383. * @param appendTo Output parameter to receive result.
  384. * Result is appended to existing contents.
  385. * @param pos On input: an alignment field, if desired.
  386. * On output: the offsets of the alignment field.
  387. * @param success Output param set to success/failure code on
  388. * exit.
  389. * @return Reference to 'appendTo' parameter.
  390. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  391. */
  392. virtual UnicodeString& format(const Formattable* objs,
  393. int32_t cnt,
  394. UnicodeString& appendTo,
  395. FieldPosition& pos,
  396. UErrorCode& success) const;
  397. using NumberFormat::parse;
  398. /**
  399. * Looks for the longest match of any message string on the input text and,
  400. * if there is a match, sets the result object to the corresponding range's number.
  401. *
  402. * If no string matches, then the parsePosition is unchanged.
  403. *
  404. * @param text The text to be parsed.
  405. * @param result Formattable to be set to the parse result.
  406. * If parse fails, return contents are undefined.
  407. * @param parsePosition The position to start parsing at on input.
  408. * On output, moved to after the last successfully
  409. * parse character. On parse failure, does not change.
  410. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  411. */
  412. virtual void parse(const UnicodeString& text,
  413. Formattable& result,
  414. ParsePosition& parsePosition) const;
  415. /**
  416. * Returns a unique class ID POLYMORPHICALLY. Part of ICU's "poor man's RTTI".
  417. *
  418. * @return The class ID for this object. All objects of a
  419. * given class have the same class ID. Objects of
  420. * other classes have different class IDs.
  421. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  422. */
  423. virtual UClassID getDynamicClassID(void) const;
  424. /**
  425. * Returns the class ID for this class. This is useful only for
  426. * comparing to a return value from getDynamicClassID(). For example:
  427. * <pre>
  428. * . Base* polymorphic_pointer = createPolymorphicObject();
  429. * . if (polymorphic_pointer->getDynamicClassID() ==
  430. * . Derived::getStaticClassID()) ...
  431. * </pre>
  432. * @return The class ID for all objects of this class.
  433. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
  434. */
  435. static UClassID U_EXPORT2 getStaticClassID(void);
  436. private:
  437. /**
  438. * Converts a double value to a string.
  439. * @param value the double number to be converted.
  440. * @param string the result string.
  441. * @return the converted string.
  442. */
  443. static UnicodeString& dtos(double value, UnicodeString& string);
  444. ChoiceFormat(); // default constructor not implemented
  445. /**
  446. * Construct a new ChoiceFormat with the limits and the corresponding formats
  447. * based on the pattern.
  448. *
  449. * @param newPattern Pattern used to construct object.
  450. * @param parseError Struct to receive information on position
  451. * of error if an error is encountered.
  452. * @param status Output param to receive success code. If the
  453. * pattern cannot be parsed, set to failure code.
  454. */
  455. ChoiceFormat(const UnicodeString& newPattern,
  456. UParseError& parseError,
  457. UErrorCode& status);
  458. friend class MessageFormat;
  459. virtual void setChoices(const double* limits,
  460. const UBool* closures,
  461. const UnicodeString* formats,
  462. int32_t count,
  463. UErrorCode &errorCode);
  464. /**
  465. * Finds the ChoiceFormat sub-message for the given number.
  466. * @param pattern A MessagePattern.
  467. * @param partIndex the index of the first ChoiceFormat argument style part.
  468. * @param number a number to be mapped to one of the ChoiceFormat argument's intervals
  469. * @return the sub-message start part index.
  470. */
  471. static int32_t findSubMessage(const MessagePattern &pattern, int32_t partIndex, double number);
  472. static double parseArgument(
  473. const MessagePattern &pattern, int32_t partIndex,
  474. const UnicodeString &source, ParsePosition &pos);
  475. /**
  476. * Matches the pattern string from the end of the partIndex to
  477. * the beginning of the limitPartIndex,
  478. * including all syntax except SKIP_SYNTAX,
  479. * against the source string starting at sourceOffset.
  480. * If they match, returns the length of the source string match.
  481. * Otherwise returns -1.
  482. */
  483. static int32_t matchStringUntilLimitPart(
  484. const MessagePattern &pattern, int32_t partIndex, int32_t limitPartIndex,
  485. const UnicodeString &source, int32_t sourceOffset);
  486. /**
  487. * Some of the ChoiceFormat constructors do not have a UErrorCode paramater.
  488. * We need _some_ way to provide one for the MessagePattern constructor.
  489. * Alternatively, the MessagePattern could be a pointer field, but that is
  490. * not nice either.
  491. */
  492. UErrorCode constructorErrorCode;
  493. /**
  494. * The MessagePattern which contains the parsed structure of the pattern string.
  495. *
  496. * Starting with ICU 4.8, the MessagePattern contains a sequence of
  497. * numeric/selector/message parts corresponding to the parsed pattern.
  498. * For details see the MessagePattern class API docs.
  499. */
  500. MessagePattern msgPattern;
  501. /**
  502. * Docs & fields from before ICU 4.8, before MessagePattern was used.
  503. * Commented out, and left only for explanation of semantics.
  504. * --------
  505. * Each ChoiceFormat divides the range -Inf..+Inf into fCount
  506. * intervals. The intervals are:
  507. *
  508. * 0: fChoiceLimits[0]..fChoiceLimits[1]
  509. * 1: fChoiceLimits[1]..fChoiceLimits[2]
  510. * ...
  511. * fCount-2: fChoiceLimits[fCount-2]..fChoiceLimits[fCount-1]
  512. * fCount-1: fChoiceLimits[fCount-1]..+Inf
  513. *
  514. * Interval 0 is special; during formatting (mapping numbers to
  515. * strings), it also contains all numbers less than
  516. * fChoiceLimits[0], as well as NaN values.
  517. *
  518. * Interval i maps to and from string fChoiceFormats[i]. When
  519. * parsing (mapping strings to numbers), then intervals map to
  520. * their lower limit, that is, interval i maps to fChoiceLimit[i].
  521. *
  522. * The intervals may be closed, half open, or open. This affects
  523. * formatting but does not affect parsing. Interval i is affected
  524. * by fClosures[i] and fClosures[i+1]. If fClosures[i]
  525. * is FALSE, then the value fChoiceLimits[i] is in interval i.
  526. * That is, intervals i and i are:
  527. *
  528. * i-1: ... x < fChoiceLimits[i]
  529. * i: fChoiceLimits[i] <= x ...
  530. *
  531. * If fClosures[i] is TRUE, then the value fChoiceLimits[i] is
  532. * in interval i-1. That is, intervals i-1 and i are:
  533. *
  534. * i-1: ... x <= fChoiceLimits[i]
  535. * i: fChoiceLimits[i] < x ...
  536. *
  537. * Because of the nature of interval 0, fClosures[0] has no
  538. * effect.
  539. */
  540. // double* fChoiceLimits;
  541. // UBool* fClosures;
  542. // UnicodeString* fChoiceFormats;
  543. // int32_t fCount;
  544. };
  545. U_NAMESPACE_END
  546. #endif // U_HIDE_DEPRECATED_API
  547. #endif /* #if !UCONFIG_NO_FORMATTING */
  548. #endif // CHOICFMT_H
  549. //eof