choicfmt.h 24 KB

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