001/*****************************************************************************
002 *                          J3D.org Copyright (c) 2000
003 *                                Java Source
004 *
005 * This source is licensed under the GNU LGPL v2.1
006 * Please read http://www.gnu.org/copyleft/lgpl.html for more information
007 *
008 ****************************************************************************/
009
010package jahuwaldt.j3d.geom;
011
012// Standard imports
013// none
014
015// Application specific imports
016// none
017
018/**
019 * Exception for when one of the requested geometry generation arrays is not
020 * big enough to contain the data requested.
021 * <P>
022 *
023 * @author Justin Couch
024 * @version $Revision: 1.1 $
025 */
026public class InvalidArraySizeException extends RuntimeException {
027
028    /**
029     * Create an exception that contains a prefabricated message.
030     *
031     * @param requested The required size of the array
032     * @param given The supplied array size
033     */
034    public InvalidArraySizeException(int requested, int given)
035    {
036        super("Required " + requested + " was given " + given);
037    }
038
039    /**
040     * Create an exception that contains the given message plus a
041     * pre-fabricated part. Typically the base message is just the array
042     * that does not have the right size.
043     *
044     * @param msg The base message to use
045     * @param requested The required size of the array
046     * @param given The supplied array size
047     */
048    public InvalidArraySizeException(String msg, int requested, int given)
049    {
050        super(msg + ". Required " + requested + " was given " + given);
051    }
052}