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 */ 017package org.apache.commons.math4.legacy.exception; 018 019import org.apache.commons.math4.legacy.exception.util.Localizable; 020import org.apache.commons.math4.legacy.exception.util.LocalizedFormats; 021 022/** 023 * Base class for all exceptions that signal that the process 024 * throwing the exception is in a state that does not comply with 025 * the set of states that it is designed to be in. 026 * 027 * @since 2.2 028 */ 029public class MathIllegalStateException extends MathRuntimeException { 030 /** Serializable version Id. */ 031 private static final long serialVersionUID = -6024911025449780478L; 032 033 /** 034 * Simple constructor. 035 * 036 * @param pattern Message pattern explaining the cause of the error. 037 * @param args Arguments. 038 */ 039 public MathIllegalStateException(Localizable pattern, Object... args) { 040 super(pattern, args); 041 } 042 043 /** 044 * Simple constructor. 045 * 046 * @param cause Root cause. 047 * @param pattern Message pattern explaining the cause of the error. 048 * @param args Arguments. 049 */ 050 public MathIllegalStateException(Throwable cause, 051 Localizable pattern, 052 Object... args) { 053 super(cause, pattern, args); 054 } 055 056 /** 057 * Default constructor. 058 */ 059 public MathIllegalStateException() { 060 this(LocalizedFormats.ILLEGAL_STATE); 061 } 062}