~ubuntu-branches/ubuntu/oneiric/commons-math/oneiric

« back to all changes in this revision

Viewing changes to src/main/java/org/apache/commons/math/MaxEvaluationsExceededException.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan, Torsten Werner, Damien Raude-Morvan
  • Date: 2011-03-07 21:14:46 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110307211446-4zea7og4eeyzhpai
Tags: 2.2-1
[ Torsten Werner ]
* Change maintainers into Maintainers.

[ Damien Raude-Morvan ]
* New upstream release (Closes: #617209).
* d/control: Bump Standards-Version to 3.9.1 (no changes needed).
* d/copyright: Refresh years, upgrade to DEP5 r166 and relicence my work
  under Apache-2.0.
* d/ant.properties: Set junit.jar to /usr/share/java/junit4.jar
  to ensure unit tests are launched.
* d/docs: Install upstream RELEASE-NOTES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
package org.apache.commons.math;
19
19
 
20
20
import org.apache.commons.math.ConvergenceException;
 
21
import org.apache.commons.math.exception.util.DummyLocalizable;
 
22
import org.apache.commons.math.exception.util.Localizable;
 
23
import org.apache.commons.math.exception.util.LocalizedFormats;
21
24
 
22
25
/**
23
26
 * Error thrown when a numerical computation exceeds its allowed
24
27
 * number of functions evaluations.
25
28
 *
26
 
 * @version $Revision: 779273 $ $Date: 2009-05-27 14:54:48 -0400 (Wed, 27 May 2009) $
 
29
 * @version $Revision: 983921 $ $Date: 2010-08-10 12:46:06 +0200 (mar. 10 août 2010) $
27
30
 * @since 2.0
28
31
 */
29
32
public class MaxEvaluationsExceededException extends ConvergenceException {
35
38
    private final int maxEvaluations;
36
39
 
37
40
    /**
38
 
     * Constructs an exception with specified formatted detail message.
39
 
     * Message formatting is delegated to {@link java.text.MessageFormat}.
 
41
     * Constructs an exception with a default detail message.
40
42
     * @param maxEvaluations maximal number of evaluations allowed
41
43
     */
42
44
    public MaxEvaluationsExceededException(final int maxEvaluations) {
43
 
        super("Maximal number of evaluations ({0}) exceeded", maxEvaluations);
 
45
        super(LocalizedFormats.MAX_EVALUATIONS_EXCEEDED, maxEvaluations);
44
46
        this.maxEvaluations = maxEvaluations;
45
47
    }
46
48
 
50
52
     * @param maxEvaluations the exceeded maximal number of evaluations
51
53
     * @param pattern format specifier
52
54
     * @param arguments format arguments
 
55
     * @deprecated as of 2.2 replaced by {@link #MaxEvaluationsExceededException(int, Localizable, Object...)}
53
56
     */
 
57
    @Deprecated
54
58
    public MaxEvaluationsExceededException(final int maxEvaluations,
55
59
                                          final String pattern, final Object ... arguments) {
 
60
        this(maxEvaluations, new DummyLocalizable(pattern), arguments);
 
61
    }
 
62
 
 
63
    /**
 
64
     * Constructs an exception with specified formatted detail message.
 
65
     * Message formatting is delegated to {@link java.text.MessageFormat}.
 
66
     * @param maxEvaluations the exceeded maximal number of evaluations
 
67
     * @param pattern format specifier
 
68
     * @param arguments format arguments
 
69
     * @since 2.2
 
70
     */
 
71
    public MaxEvaluationsExceededException(final int maxEvaluations,
 
72
                                           final Localizable pattern, final Object ... arguments) {
56
73
        super(pattern, arguments);
57
74
        this.maxEvaluations = maxEvaluations;
58
75
    }