View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  /*
19   * This is not the original file distributed by the Apache Software Foundation
20   * It has been modified by the Hipparchus project
21   */
22  package org.hipparchus.exception;
23  
24  import java.util.Locale;
25  
26  /**
27   * Enumeration for localized messages formats used in exceptions messages.
28   * <p>
29   * The constants in this enumeration represent the available
30   * formats as localized strings. These formats are intended to be
31   * localized using simple properties files, using the constant
32   * name as the key and the property value as the message format.
33   * The source English format is provided in the constants themselves
34   * to serve both as a reminder for developers to understand the parameters
35   * needed by each format, as a basis for translators to create
36   * localized properties files, and as a default format if some
37   * translation is missing.
38   * </p>
39   */
40  public enum LocalizedCoreFormats implements Localizable {
41  
42      /** ARRAY_SIZE_EXCEEDS_MAX_VARIABLES. */
43      ARRAY_SIZE_EXCEEDS_MAX_VARIABLES("array size cannot be greater than {0}"),
44  
45      /** ARRAY_SIZES_SHOULD_HAVE_DIFFERENCE_1. */
46      ARRAY_SIZES_SHOULD_HAVE_DIFFERENCE_1("array sizes should have difference 1 ({0} != {1} + 1)"),
47  
48      /** ARRAY_SUMS_TO_ZERO. */
49      ARRAY_SUMS_TO_ZERO("array sums to zero"),
50  
51      /** AT_LEAST_ONE_COLUMN. */
52      AT_LEAST_ONE_COLUMN("matrix must have at least one column"),
53  
54      /** AT_LEAST_ONE_ROW. */
55      AT_LEAST_ONE_ROW("matrix must have at least one row"),
56  
57      /** BANDWIDTH. */
58      BANDWIDTH("bandwidth ({0})"),
59  
60      /** BESSEL_FUNCTION_BAD_ARGUMENT. */
61      BESSEL_FUNCTION_BAD_ARGUMENT("Bessel function of order {0} cannot be computed for x = {1}"),
62  
63      /** BESSEL_FUNCTION_FAILED_CONVERGENCE. */
64      BESSEL_FUNCTION_FAILED_CONVERGENCE("Bessel function of order {0} failed to converge for x = {1}"),
65  
66      /** BINOMIAL_INVALID_PARAMETERS_ORDER. */
67      BINOMIAL_INVALID_PARAMETERS_ORDER("must have n >= k for binomial coefficient (n, k), got k = {0}, n = {1}"),
68  
69      /** BINOMIAL_NEGATIVE_PARAMETER. */
70      BINOMIAL_NEGATIVE_PARAMETER("must have n >= 0 for binomial coefficient (n, k), got n = {0}"),
71  
72      /** CANNOT_COMPUTE_0TH_ROOT_OF_UNITY. */
73      CANNOT_COMPUTE_0TH_ROOT_OF_UNITY("cannot compute 0-th root of unity, indefinite result"),
74  
75      /** CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA. */
76      CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA("cannot compute beta density at 0 when alpha = {0,number}"),
77  
78      /** CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA. */
79      CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA("cannot compute beta density at 1 when beta = %.3g"),
80  
81      /** CANNOT_COMPUTE_NTH_ROOT_FOR_NEGATIVE_N. */
82      CANNOT_COMPUTE_NTH_ROOT_FOR_NEGATIVE_N("cannot compute nth root for null or negative n: {0}"),
83  
84      /** CANNOT_DISCARD_NEGATIVE_NUMBER_OF_ELEMENTS. */
85      CANNOT_DISCARD_NEGATIVE_NUMBER_OF_ELEMENTS("cannot discard a negative number of elements ({0})"),
86  
87      /** CANNOT_FORMAT_INSTANCE_AS_COMPLEX. */
88      CANNOT_FORMAT_INSTANCE_AS_COMPLEX("cannot format a {0} instance as a complex number"),
89  
90      /** CANNOT_FORMAT_OBJECT_TO_FRACTION. */
91      CANNOT_FORMAT_OBJECT_TO_FRACTION("cannot format given object as a fraction number"),
92  
93      /** CANNOT_SUBSTITUTE_ELEMENT_FROM_EMPTY_ARRAY. */
94      CANNOT_SUBSTITUTE_ELEMENT_FROM_EMPTY_ARRAY("cannot substitute an element from an empty array"),
95  
96      /** COLUMN_INDEX. */
97      COLUMN_INDEX("column index ({0})"), /* keep */
98  
99      /** COMPLEX_CANNOT_BE_CONSIDERED_A_REAL_NUMBER. */
100     COMPLEX_CANNOT_BE_CONSIDERED_A_REAL_NUMBER("complex number ({0},{1}) cannot be considered to be a real number"),
101 
102     /** CONSTRAINT. */
103     CONSTRAINT("constraint"), /* keep */
104 
105     /** CONTINUED_FRACTION_INFINITY_DIVERGENCE. */
106     CONTINUED_FRACTION_INFINITY_DIVERGENCE("Continued fraction convergents diverged to +/- infinity for value {0}"),
107 
108     /** CONTINUED_FRACTION_NAN_DIVERGENCE. */
109     CONTINUED_FRACTION_NAN_DIVERGENCE("Continued fraction diverged to NaN for value {0}"),
110 
111     /** CONTRACTION_CRITERIA_SMALLER_THAN_EXPANSION_FACTOR. */
112     CONTRACTION_CRITERIA_SMALLER_THAN_EXPANSION_FACTOR("contraction criteria ({0}) smaller than the expansion factor ({1}).  This would lead to a never ending loop of expansion and contraction as a newly expanded internal storage array would immediately satisfy the criteria for contraction."),
113 
114     /** CONTRACTION_CRITERIA_SMALLER_THAN_ONE. */
115     CONTRACTION_CRITERIA_SMALLER_THAN_ONE("contraction criteria smaller than one ({0}).  This would lead to a never ending loop of expansion and contraction as an internal storage array length equal to the number of elements would satisfy the contraction criteria."),
116 
117     /** CONVERGENCE_FAILED. */
118     CONVERGENCE_FAILED("convergence failed"), /* keep */
119 
120     /** CUMULATIVE_PROBABILITY_RETURNED_NAN. */
121     CUMULATIVE_PROBABILITY_RETURNED_NAN("Cumulative probability function returned NaN for argument {0} p = {1}"),
122 
123     /** DERIVATION_ORDER_NOT_ALLOWED. */
124     DERIVATION_ORDER_NOT_ALLOWED("derivation order {0} is not allowed here"),
125 
126     /** DIFFERENT_ROWS_LENGTHS. */
127     DIFFERENT_ROWS_LENGTHS("some rows have length {0} while others have length {1}"),
128 
129     /** DIGEST_NOT_INITIALIZED. */
130     DIGEST_NOT_INITIALIZED("digest not initialized"),
131 
132     /** DIMENSIONS_MISMATCH_2x2. */
133     DIMENSIONS_MISMATCH_2x2("got {0}x{1} but expected {2}x{3}"), /* keep */
134 
135     /** DIMENSIONS_MISMATCH. */
136     DIMENSIONS_MISMATCH("inconsistent dimensions: {0} != {1}"), /* keep */
137 
138     /** DISCRETE_CUMULATIVE_PROBABILITY_RETURNED_NAN. */
139     DISCRETE_CUMULATIVE_PROBABILITY_RETURNED_NAN("Discrete cumulative probability function returned NaN for argument {0}"),
140 
141     /** DISTRIBUTION_NOT_LOADED. */
142     DISTRIBUTION_NOT_LOADED("distribution not loaded"),
143 
144     /** DUPLICATED_ABSCISSA_DIVISION_BY_ZERO. */
145     DUPLICATED_ABSCISSA_DIVISION_BY_ZERO("duplicated abscissa {0} causes division by zero"),
146 
147     /** EMPTY_INTERPOLATION_SAMPLE. */
148     EMPTY_INTERPOLATION_SAMPLE("sample for interpolation is empty"),
149 
150     /** EMPTY_POLYNOMIALS_COEFFICIENTS_ARRAY. */
151     EMPTY_POLYNOMIALS_COEFFICIENTS_ARRAY("empty polynomials coefficients array"), /* keep */
152 
153     /** EMPTY_SELECTED_COLUMN_INDEX_ARRAY. */
154     EMPTY_SELECTED_COLUMN_INDEX_ARRAY("empty selected column index array"),
155 
156     /** EMPTY_SELECTED_ROW_INDEX_ARRAY. */
157     EMPTY_SELECTED_ROW_INDEX_ARRAY("empty selected row index array"),
158 
159     /** ENDPOINTS_NOT_AN_INTERVAL. */
160     ENDPOINTS_NOT_AN_INTERVAL("endpoints do not specify an interval: [{0}, {1}]"),
161 
162     /** EVALUATION. */
163     EVALUATION("evaluation"), /* keep */
164 
165     /** EXPANSION_FACTOR_SMALLER_THAN_ONE. */
166     EXPANSION_FACTOR_SMALLER_THAN_ONE("expansion factor smaller than one ({0})"),
167 
168     /** FACTORIAL_NEGATIVE_PARAMETER. */
169     FACTORIAL_NEGATIVE_PARAMETER("must have n >= 0 for n!, got n = {0}"),
170 
171     /** FAILED_BRACKETING. */
172     FAILED_BRACKETING("number of iterations={4}, maximum iterations={5}, initial={6}, lower bound={7}, upper bound={8}, final a value={0}, final b value={1}, f(a)={2}, f(b)={3}"),
173 
174     /** FAILED_DECOMPOSITION. */
175     FAILED_DECOMPOSITION("failed decomposition of a {0}x{1} matrix"),
176 
177     /** FAILED_FRACTION_CONVERSION. */
178     FAILED_FRACTION_CONVERSION("Unable to convert {0} to fraction after {1} iterations"),
179 
180     /** FIRST_COLUMNS_NOT_INITIALIZED_YET. */
181     FIRST_COLUMNS_NOT_INITIALIZED_YET("first {0} columns are not initialized yet"),
182 
183     /** FIRST_ROWS_NOT_INITIALIZED_YET. */
184     FIRST_ROWS_NOT_INITIALIZED_YET("first {0} rows are not initialized yet"),
185 
186     /** FRACTION_CONVERSION_OVERFLOW. */
187     FRACTION_CONVERSION_OVERFLOW("Overflow trying to convert {0} to fraction ({1}/{2})"),
188 
189     /** GCD_OVERFLOW_32_BITS. */
190     GCD_OVERFLOW_32_BITS("overflow: gcd({0}, {1}) is 2^31"),
191 
192     /** GCD_OVERFLOW_64_BITS. */
193     GCD_OVERFLOW_64_BITS("overflow: gcd({0}, {1}) is 2^63"),
194 
195     /** ILL_CONDITIONED_OPERATOR. */
196     ILL_CONDITIONED_OPERATOR("condition number {1} is too high "),
197 
198     /** INDEX_LARGER_THAN_MAX. */
199     INDEX_LARGER_THAN_MAX("the index specified: {0} is larger than the current maximal index {1}"),
200 
201     /** INDEX_NOT_POSITIVE. */
202     INDEX_NOT_POSITIVE("index ({0}) is not positive"),
203 
204     /** INDEX. */
205     INDEX("index ({0})"), /* keep */
206 
207     /** NOT_FINITE_NUMBER. */
208     NOT_FINITE_NUMBER("{0} is not a finite number"), /* keep */
209 
210     /** INFINITE_BOUND. */
211     INFINITE_BOUND("interval bounds must be finite"),
212 
213     /** ARRAY_ELEMENT. */
214     ARRAY_ELEMENT("value {0} at index {1}"), /* keep */
215 
216     /** INFINITE_ARRAY_ELEMENT. */
217     INFINITE_ARRAY_ELEMENT("Array contains an infinite element, {0} at index {1}"),
218 
219     /** INFINITE_VALUE_CONVERSION. */
220     INFINITE_VALUE_CONVERSION("cannot convert infinite value"),
221 
222     /** INITIAL_CAPACITY_NOT_POSITIVE. */
223     INITIAL_CAPACITY_NOT_POSITIVE("initial capacity ({0}) is not positive"),
224 
225     /** INITIAL_COLUMN_AFTER_FINAL_COLUMN. */
226     INITIAL_COLUMN_AFTER_FINAL_COLUMN("initial column {1} after final column {0}"),
227 
228     /** INITIAL_ROW_AFTER_FINAL_ROW. */
229     INITIAL_ROW_AFTER_FINAL_ROW("initial row {1} after final row {0}"),
230 
231     /** INSUFFICIENT_DATA. */
232     INSUFFICIENT_DATA("insufficient data"),
233 
234     /** INSUFFICIENT_DIMENSION. */
235     INSUFFICIENT_DIMENSION("insufficient dimension {0}, must be at least {1}"),
236 
237     /** DIMENSION. */
238     DIMENSION("dimension ({0})"), /* keep */
239 
240     /** INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE. */
241     INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE("sample contains {0} observed points, at least {1} are required"),
242 
243     /** INSUFFICIENT_ROWS_AND_COLUMNS. */
244     INSUFFICIENT_ROWS_AND_COLUMNS("insufficient data: only {0} rows and {1} columns."),
245 
246     /** INTERNAL_ERROR. */
247     INTERNAL_ERROR("internal error, please fill a bug report at {0}"),
248 
249     /** INVALID_MAX_ITERATIONS. */
250     INVALID_MAX_ITERATIONS("bad value for maximum iterations number: {0}"),
251 
252     /** ITERATIONS. */
253     ITERATIONS("iterations"), /* keep */
254 
255     /** LCM_OVERFLOW_32_BITS. */
256     LCM_OVERFLOW_32_BITS("overflow: lcm({0}, {1}) is 2^31"),
257 
258     /** LCM_OVERFLOW_64_BITS. */
259     LCM_OVERFLOW_64_BITS("overflow: lcm({0}, {1}) is 2^63"),
260 
261     /** LOWER_BOUND_NOT_BELOW_UPPER_BOUND. */
262     LOWER_BOUND_NOT_BELOW_UPPER_BOUND("lower bound ({0}) must be strictly less than upper bound ({1})"), /* keep */
263 
264     /** LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT. */
265     LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT("lower endpoint ({0}) must be less than or equal to upper endpoint ({1})"),
266 
267     /** EVALUATIONS. */
268     EVALUATIONS("evaluations"), /* keep */
269 
270     /** MAX_COUNT_EXCEEDED. */
271     MAX_COUNT_EXCEEDED("maximal count ({0}) exceeded"), /* keep */
272 
273     /** NAN_ELEMENT_AT_INDEX. */
274     NAN_ELEMENT_AT_INDEX("element {0} is NaN"),
275 
276     /** NAN_VALUE_CONVERSION. */
277     NAN_VALUE_CONVERSION("cannot convert NaN value"),
278 
279     /** NEGATIVE_DEFINITE_MATRIX. */
280     NEGATIVE_DEFINITE_MATRIX("negative definite matrix"),
281 
282     /** NEGATIVE_COMPLEX_MODULE. */
283     NEGATIVE_COMPLEX_MODULE("negative complex module {0}"),
284 
285     /** NEGATIVE_ELEMENT_AT_INDEX. */
286     NEGATIVE_ELEMENT_AT_INDEX("element {0} is negative: {1}"),
287 
288     /** NUMBER_OF_SUCCESSES. */
289     NUMBER_OF_SUCCESSES("number of successes ({0})"), /* keep */
290 
291     /** NUMBER_OF_INTERPOLATION_POINTS. */
292     NUMBER_OF_INTERPOLATION_POINTS("number of interpolation points ({0})"), /* keep */
293 
294     /** NUMBER_OF_TRIALS. */
295     NUMBER_OF_TRIALS("number of trials ({0})"),
296 
297     /** ROBUSTNESS_ITERATIONS. */
298     ROBUSTNESS_ITERATIONS("number of robustness iterations ({0})"),
299 
300     /** START_POSITION. */
301     START_POSITION("start position ({0})"), /* keep */
302 
303     /** NON_CONVERGENT_CONTINUED_FRACTION. */
304     NON_CONVERGENT_CONTINUED_FRACTION("Continued fraction convergents failed to converge (in less than {0} iterations) for value {1}"),
305 
306     /** NON_SQUARE_MATRIX. */
307     NON_SQUARE_MATRIX("non square ({0}x{1}) matrix"),
308 
309     /** NORM. */
310     NORM("Norm ({0})"), /* keep */
311 
312     /** NORMALIZE_INFINITE. */
313     NORMALIZE_INFINITE("Cannot normalize to an infinite value"),
314 
315     /** NORMALIZE_NAN. */
316     NORMALIZE_NAN("Cannot normalize to NaN"),
317 
318     /** NOT_DECREASING_SEQUENCE. */
319     NOT_DECREASING_SEQUENCE("points {3} and {2} are not decreasing ({1} < {0})"), /* keep */
320 
321     /** NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION. */
322     NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION("spline partition must have at least {0} points, got {1}"),
323 
324     /** NOT_INCREASING_SEQUENCE. */
325     NOT_INCREASING_SEQUENCE("points {3} and {2} are not increasing ({1} > {0})"), /* keep */
326 
327     /** NOT_POSITIVE_DEFINITE_MATRIX. */
328     NOT_POSITIVE_DEFINITE_MATRIX("not positive definite matrix"), /* keep */
329 
330     /** NON_POSITIVE_DEFINITE_OPERATOR. */
331     NON_POSITIVE_DEFINITE_OPERATOR("non positive definite linear operator"), /* keep */
332 
333     /** NON_SELF_ADJOINT_OPERATOR. */
334     NON_SELF_ADJOINT_OPERATOR("non self-adjoint linear operator"), /* keep */
335 
336     /** NON_SQUARE_OPERATOR. */
337     NON_SQUARE_OPERATOR("non square ({0}x{1}) linear operator"), /* keep */
338 
339     /** DEGREES_OF_FREEDOM. */
340     DEGREES_OF_FREEDOM("degrees of freedom ({0})"), /* keep */
341 
342     /** NOT_POSITIVE_EXPONENT. */
343     NOT_POSITIVE_EXPONENT("invalid exponent {0} (must be positive)"),
344 
345     /** NUMBER_OF_ELEMENTS_SHOULD_BE_POSITIVE. */
346     NUMBER_OF_ELEMENTS_SHOULD_BE_POSITIVE("number of elements should be positive ({0})"),
347 
348     /** BASE. */
349     BASE("base ({0})"), /* keep */
350 
351     /** EXPONENT. */
352     EXPONENT("exponent ({0})"), /* keep */
353 
354     /** LENGTH. */
355     LENGTH("length ({0})"), /* keep */
356 
357     /** MEAN. */
358     MEAN("mean ({0})"), /* keep */
359 
360     /** NOT_POSITIVE_NUMBER_OF_SAMPLES. */
361     NOT_POSITIVE_NUMBER_OF_SAMPLES("number of sample is not positive: {0}"),
362 
363     /** NUMBER_OF_SAMPLES. */
364     NUMBER_OF_SAMPLES("number of samples ({0})"), /* keep */
365 
366     /** PERMUTATION_SIZE. */
367     PERMUTATION_SIZE("permutation size ({0}"), /* keep */
368 
369     /** POPULATION_SIZE. */
370     POPULATION_SIZE("population size ({0})"), /* keep */
371 
372     /** NOT_POSITIVE_SCALE. */
373     NOT_POSITIVE_SCALE("scale must be positive ({0})"),
374 
375     /** SCALE. */
376     SCALE("scale ({0})"), /* keep */
377 
378     /** SHAPE. */
379     SHAPE("shape ({0})"), /* keep */
380 
381     /** STANDARD_DEVIATION. */
382     STANDARD_DEVIATION("standard deviation ({0})"), /* keep */
383 
384     /** NOT_POSITIVE_WINDOW_SIZE. */
385     NOT_POSITIVE_WINDOW_SIZE("window size must be positive ({0})"),
386 
387     /** NOT_STRICTLY_DECREASING_SEQUENCE. */
388     NOT_STRICTLY_DECREASING_SEQUENCE("points {3} and {2} are not strictly decreasing ({1} <= {0})"), /* keep */
389 
390     /** NOT_STRICTLY_INCREASING_SEQUENCE. */
391     NOT_STRICTLY_INCREASING_SEQUENCE("points {3} and {2} are not strictly increasing ({1} >= {0})"), /* keep */
392 
393     /** NON_SYMMETRIC_MATRIX. */
394     NON_SYMMETRIC_MATRIX("non symmetric matrix: the difference between entries at ({0},{1}) and ({1},{0}) is larger than {2}"), /* keep */
395 
396     /** NO_CONVERGENCE_WITH_ANY_START_POINT. */
397     NO_CONVERGENCE_WITH_ANY_START_POINT("none of the {0} start points lead to convergence"), /* keep */
398 
399     /** NO_DATA. */
400     NO_DATA("no data"), /* keep */
401 
402     /** NO_OPTIMUM_COMPUTED_YET. */
403     NO_OPTIMUM_COMPUTED_YET("no optimum computed yet"), /* keep */
404 
405     /** NAN_NOT_ALLOWED. */
406     NAN_NOT_ALLOWED("NaN is not allowed"),
407 
408     /** NULL_NOT_ALLOWED. */
409     NULL_NOT_ALLOWED("null is not allowed"), /* keep */
410 
411     /** ARRAY_ZERO_LENGTH_OR_NULL_NOT_ALLOWED. */
412     ARRAY_ZERO_LENGTH_OR_NULL_NOT_ALLOWED("a null or zero length array not allowed"),
413 
414     /** DENOMINATOR. */
415     DENOMINATOR("denominator"), /* keep */
416 
417     /** DENOMINATOR_FORMAT. */
418     DENOMINATOR_FORMAT("denominator format"), /* keep */
419 
420     /** FRACTION. */
421     FRACTION("fraction"), /* keep */
422 
423     /** FUNCTION. */
424     FUNCTION("function"), /* keep */
425 
426     /** IMAGINARY_FORMAT. */
427     IMAGINARY_FORMAT("imaginary format"), /* keep */
428 
429     /** INPUT_ARRAY. */
430     INPUT_ARRAY("input array"), /* keep */
431 
432     /** NUMERATOR. */
433     NUMERATOR("numerator"), /* keep */
434 
435     /** NUMERATOR_FORMAT. */
436     NUMERATOR_FORMAT("numerator format"), /* keep */
437 
438     /** REAL_FORMAT. */
439     REAL_FORMAT("real format"), /* keep */
440 
441     /** WHOLE_FORMAT. */
442     WHOLE_FORMAT("whole format"), /* keep */
443 
444     /** NUMBER_TOO_LARGE. */
445     NUMBER_TOO_LARGE("{0} is larger than the maximum ({1})"), /* keep */
446 
447     /** NUMBER_TOO_SMALL. */
448     NUMBER_TOO_SMALL("{0} is smaller than the minimum ({1})"), /* keep */
449 
450     /** NUMBER_TOO_LARGE_BOUND_EXCLUDED. */
451     NUMBER_TOO_LARGE_BOUND_EXCLUDED("{0} is larger than, or equal to, the maximum ({1})"), /* keep */
452 
453     /** NUMBER_TOO_SMALL_BOUND_EXCLUDED. */
454     NUMBER_TOO_SMALL_BOUND_EXCLUDED("{0} is smaller than, or equal to, the minimum ({1})"), /* keep */
455 
456     /** NUMBER_OF_SUCCESS_LARGER_THAN_POPULATION_SIZE. */
457     NUMBER_OF_SUCCESS_LARGER_THAN_POPULATION_SIZE("number of successes ({0}) must be less than or equal to population size ({1})"),
458 
459     /** NUMERATOR_OVERFLOW_AFTER_MULTIPLY. */
460     NUMERATOR_OVERFLOW_AFTER_MULTIPLY("overflow, numerator too large after multiply: {0}"),
461 
462     /** OBSERVED_COUNTS_BOTTH_ZERO_FOR_ENTRY. */
463     OBSERVED_COUNTS_BOTTH_ZERO_FOR_ENTRY("observed counts are both zero for entry {0}"),
464 
465     /** OUT_OF_RANGE_ROOT_OF_UNITY_INDEX. */
466     OUT_OF_RANGE_ROOT_OF_UNITY_INDEX("out of range root of unity index {0} (must be in [{1};{2}])"),
467 
468     /** OUT_OF_RANGE. */
469     OUT_OF_RANGE("out of range"), /* keep */
470 
471     /** OUT_OF_RANGE_SIMPLE. */
472     OUT_OF_RANGE_SIMPLE("{0} out of [{1}, {2}] range"), /* keep */
473 
474     /** OUT_OF_RANGE_LEFT. */
475     OUT_OF_RANGE_LEFT("{0} out of ({1}, {2}] range"),
476 
477     /** OVERFLOW. */
478     OVERFLOW("overflow"), /* keep */
479 
480     /** OVERFLOW_IN_FRACTION. */
481     OVERFLOW_IN_FRACTION("overflow in fraction {0}/{1}, cannot negate"),
482 
483     /** OVERFLOW_IN_ADDITION. */
484     OVERFLOW_IN_ADDITION("overflow in addition: {0} + {1}"),
485 
486     /** OVERFLOW_IN_SUBTRACTION. */
487     OVERFLOW_IN_SUBTRACTION("overflow in subtraction: {0} - {1}"),
488 
489     /** OVERFLOW_IN_MULTIPLICATION. */
490     OVERFLOW_IN_MULTIPLICATION("overflow in multiplication: {0} * {1}"),
491 
492     /** PERMUTATION_EXCEEDS_N. */
493     PERMUTATION_EXCEEDS_N("permutation size ({0}) exceeds permuation domain ({1})"), /* keep */
494 
495     /** POLYNOMIAL. */
496     POLYNOMIAL("polynomial"), /* keep */
497 
498     /** ROOTS_OF_UNITY_NOT_COMPUTED_YET. */
499     ROOTS_OF_UNITY_NOT_COMPUTED_YET("roots of unity have not been computed yet"),
500 
501     /** ROW_INDEX. */
502     ROW_INDEX("row index ({0})"), /* keep */
503 
504     /** NOT_BRACKETING_INTERVAL. */
505     NOT_BRACKETING_INTERVAL("interval does not bracket a root: f({0,number,##0.################E0}) = {2,number,##0.################E0}, f({1,number,##0.################E0}) = {3,number,##0.################E0}"),
506 
507     /** START_POINT_NOT_IN_INTERVAL. */
508     START_POINT_NOT_IN_INTERVAL("The start point {0} is not in the interval [{1}, {2}]"),
509 
510     /** SAMPLE_SIZE_EXCEEDS_COLLECTION_SIZE. */
511     SAMPLE_SIZE_EXCEEDS_COLLECTION_SIZE("sample size ({0}) exceeds collection size ({1})"), /* keep */
512 
513     /** SAMPLE_SIZE_LARGER_THAN_POPULATION_SIZE. */
514     SAMPLE_SIZE_LARGER_THAN_POPULATION_SIZE("sample size ({0}) must be less than or equal to population size ({1})"),
515 
516     /** SIMPLE_MESSAGE. */
517     SIMPLE_MESSAGE("{0}"),
518 
519     /** SINGULAR_MATRIX. */
520     SINGULAR_MATRIX("matrix is singular"), /* keep */
521 
522     /** SINGULAR_OPERATOR. */
523     SINGULAR_OPERATOR("operator is singular"),
524 
525     /** SUBARRAY_ENDS_AFTER_ARRAY_END. */
526     SUBARRAY_ENDS_AFTER_ARRAY_END("subarray ends after array end"),
527 
528     /** TOO_LARGE_CUTOFF_SINGULAR_VALUE. */
529     TOO_LARGE_CUTOFF_SINGULAR_VALUE("cutoff singular value is {0}, should be at most {1}"),
530 
531     /** TOO_MANY_ELEMENTS_TO_DISCARD_FROM_ARRAY. */
532     TOO_MANY_ELEMENTS_TO_DISCARD_FROM_ARRAY("cannot discard {0} elements from a {1} elements array"),
533 
534     /** UNKNOWN_MODE. */
535     UNKNOWN_MODE("unknown mode {0}, known modes: {1} ({2}), {3} ({4}), {5} ({6}), {7} ({8}), {9} ({10}) and {11} ({12})"),
536 
537     /** CANNOT_PARSE_AS_TYPE. */
538     CANNOT_PARSE_AS_TYPE("string \"{0}\" unparseable (from position {1}) as an object of type {2}"), /* keep */
539 
540     /** CANNOT_PARSE. */
541     CANNOT_PARSE("string \"{0}\" unparseable (from position {1})"), /* keep */
542 
543     /** UNSUPPORTED_OPERATION. */
544     UNSUPPORTED_OPERATION("unsupported operation"), /* keep */
545 
546     /** ARITHMETIC_EXCEPTION. */
547     ARITHMETIC_EXCEPTION("arithmetic exception"), /* keep */
548 
549     /** ILLEGAL_STATE. */
550     ILLEGAL_STATE("illegal state"), /* keep */
551 
552     /** USER_EXCEPTION. */
553     USER_EXCEPTION("exception generated in user code"), /* keep */
554 
555     /** URL_CONTAINS_NO_DATA. */
556     URL_CONTAINS_NO_DATA("URL {0} contains no data"),
557 
558     /** VECTOR_MUST_HAVE_AT_LEAST_ONE_ELEMENT. */
559     VECTOR_MUST_HAVE_AT_LEAST_ONE_ELEMENT("vector must have at least one element"),
560 
561     /** WEIGHT_AT_LEAST_ONE_NON_ZERO. */
562     WEIGHT_AT_LEAST_ONE_NON_ZERO("weight array must contain at least one non-zero value"),
563 
564     /** WRONG_NUMBER_OF_POINTS. */
565     WRONG_NUMBER_OF_POINTS("{0} points are required, got only {1}"),
566 
567     /** NUMBER_OF_POINTS. */
568     NUMBER_OF_POINTS("number of points ({0})"), /* keep */
569 
570     /** ZERO_DENOMINATOR. */
571     ZERO_DENOMINATOR("denominator must be different from 0"), /* keep */
572 
573     /** ZERO_DENOMINATOR_IN_FRACTION. */
574     ZERO_DENOMINATOR_IN_FRACTION("zero denominator in fraction {0}/{1}"),
575 
576     /** ZERO_FRACTION_TO_DIVIDE_BY. */
577     ZERO_FRACTION_TO_DIVIDE_BY("the fraction to divide by must not be zero: {0}/{1}"),
578 
579     /** ZERO_NORM. */
580     ZERO_NORM("zero norm"),
581 
582     /** ZERO_NOT_ALLOWED. */
583     ZERO_NOT_ALLOWED("zero not allowed here"),
584 
585     /** ZERO_STATE_SIZE. */
586     ZERO_STATE_SIZE("state dimension must be different from 0"),
587 
588     /** RIGHT_EDGE_GREATER_THAN_LEFT_EDGE. */
589     RIGHT_EDGE_GREATER_THAN_LEFT_EDGE("left edge {0} should be smaller than right edge {1}"),
590 
591     /** INPUT_EXPECTED_BETWEEN_ZERO_AND_ONE_INCLUDED. */
592     INPUT_EXPECTED_BETWEEN_ZERO_AND_ONE_INCLUDED("input {0} is expected to be between [0:1]");
593 
594     /** Source English format. */
595     private final String sourceFormat;
596 
597     /** Simple constructor.
598      * @param sourceFormat source English format to use when no
599      * localized version is available
600      */
601     LocalizedCoreFormats(final String sourceFormat) {
602         this.sourceFormat = sourceFormat;
603     }
604 
605     /** {@inheritDoc} */
606     @Override
607     public String getSourceString() {
608         return sourceFormat;
609     }
610 
611     /** {@inheritDoc} */
612     @Override
613     public String getLocalizedString(final Locale locale) {
614         return getLocalizedString("assets/" + LocalizedCoreFormats.class.getName().replaceAll("\\.", "/"),
615                                   name(), locale);
616     }
617 
618 }