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 *      http://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 */
17package org.apache.commons.math.exception;
18
19import java.util.Locale;
20
21import org.apache.commons.math.exception.util.Localizable;
22
23/**
24* Interface for commons-math throwables.
25*
26* @version $Revision: 1035475 $ $Date: 2010-11-15 23:39:25 +0100 (lun. 15 nov. 2010) $
27* @since 2.2
28*/
29public interface MathThrowable {
30
31    /** Gets the localizable pattern used to build the specific part of the message of this throwable.
32     * @return localizable pattern used to build the specific part of the message of this throwable
33     */
34    Localizable getSpecificPattern();
35
36    /** Gets the localizable pattern used to build the general part of the message of this throwable.
37     * @return localizable pattern used to build the general part of the message of this throwable
38     */
39    Localizable getGeneralPattern();
40
41    /** Gets the arguments used to build the message of this throwable.
42     * @return the arguments used to build the message of this throwable
43     */
44    Object[] getArguments();
45
46    /** Gets the message in a specified locale.
47     * @param locale Locale in which the message should be translated
48     * @return localized message
49     */
50    String getMessage(final Locale locale);
51
52    /** Gets the message in a conventional US locale.
53     * @return localized message
54     */
55    String getMessage();
56
57    /** Gets the message in the system default locale.
58     * @return localized message
59     */
60    String getLocalizedMessage();
61
62}
63