001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.commons.math;
018    
019    import java.io.Serializable;
020    
021    import org.apache.commons.math.exception.util.DummyLocalizable;
022    import org.apache.commons.math.exception.util.Localizable;
023    
024    /**
025     * Signals a configuration problem with any of the factory methods.
026     * @version $Revision: 983921 $ $Date: 2010-08-10 12:46:06 +0200 (mar. 10 ao??t 2010) $
027     */
028    public class MathConfigurationException extends MathException implements Serializable{
029    
030        /** Serializable version identifier */
031        private static final long serialVersionUID = 5261476508226103366L;
032    
033        /**
034         * Default constructor.
035         */
036        public MathConfigurationException() {
037            super();
038        }
039    
040        /**
041         * Constructs an exception with specified formatted detail message.
042         * Message formatting is delegated to {@link java.text.MessageFormat}.
043         * @param pattern format specifier
044         * @param arguments format arguments
045         * @since 1.2
046         */
047        public MathConfigurationException(String pattern, Object ... arguments) {
048            this(new DummyLocalizable(pattern), arguments);
049        }
050    
051        /**
052         * Constructs an exception with specified formatted detail message.
053         * Message formatting is delegated to {@link java.text.MessageFormat}.
054         * @param pattern format specifier
055         * @param arguments format arguments
056         * @since 2.2
057         */
058        public MathConfigurationException(Localizable pattern, Object ... arguments) {
059            super(pattern, arguments);
060        }
061    
062        /**
063         * Create an exception with a given root cause.
064         * @param cause  the exception or error that caused this exception to be thrown
065         */
066        public MathConfigurationException(Throwable cause) {
067            super(cause);
068        }
069    
070        /**
071         * Constructs an exception with specified formatted detail message and root cause.
072         * Message formatting is delegated to {@link java.text.MessageFormat}.
073         * @param cause  the exception or error that caused this exception to be thrown
074         * @param pattern format specifier
075         * @param arguments format arguments
076         * @since 1.2
077         */
078        public MathConfigurationException(Throwable cause, String pattern, Object ... arguments) {
079            this(cause, new DummyLocalizable(pattern), arguments);
080        }
081    
082        /**
083         * Constructs an exception with specified formatted detail message and root cause.
084         * Message formatting is delegated to {@link java.text.MessageFormat}.
085         * @param cause  the exception or error that caused this exception to be thrown
086         * @param pattern format specifier
087         * @param arguments format arguments
088         * @since 2.2
089         */
090        public MathConfigurationException(Throwable cause, Localizable pattern, Object ... arguments) {
091            super(cause, pattern, arguments);
092        }
093    
094    }