001package Torello.Java;
002
003/**
004 * Used when a parameter accepts an intance of {@code 'Object'}, but stipulates that this reference
005 * must be a reference to a primitive-array.  If an instance of a non-primitive-array is passed,
006 * it may be the case that the code causing the exception should re-evaluate the use of whatever
007 * method generated that error.
008 * 
009 * <BR /><BR />This class inherit {@code 'Error'}, rather than {@code 'Exception'} because likely
010 * the programmer really has typed something incorrect into his / her code.  In this JAR library,
011 * this error is thrown <I>from within an exception-check method
012 * {@link ParallelArrayException#check(Object, String, Object, String)}</I>.  Exception check's
013 * that generate other exception's necessitate inheriting {@code 'Error'}.
014 */
015public class ArrayExpectedError extends ExceptionCheckError
016{
017    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX>  */
018    public static final long serialVersionUID = 1;
019
020    /** Constructs an {@code 'ArrayExpectedError'} with no detail message. */
021    public ArrayExpectedError()
022    { super(); }
023
024    /**
025     * Constructs an {@code 'ArrayExpectedError'} with the specified detail message.
026     * 
027     * @param message the detail message.
028     */
029    public ArrayExpectedError(String message)
030    { super(message); }
031
032    /**
033     * Constructs a new error with the specified detail {@code 'message'} and 
034     * {@code 'cause'}.
035     * 
036     * <BR /><BR /><B>NOTE:</B> The detail message associated with {@code 'cause'} is not
037     * automatically incorporated in this error's detail message.
038     * 
039     * @param message The detail message (which is saved for later retrieval by th
040     * {@code Throwable.getMessage()} method).
041     * 
042     * @param cause the cause (which is saved for later retrieval by the
043     * {@code Throwable.getCause()} method). (A null value is permitted, and indicates that the
044     * cause is nonexistent or unknown.)
045     */
046    public ArrayExpectedError(String message, Throwable cause)
047    { super(message); initCause(cause); }
048
049    /**
050     * Constructs a new error with the specified {@code 'cause'} and a detail message of
051     * {@code (cause==null ? null : cause.toString())} (which typically contains the class
052     * and detail message of cause).  This constructor is useful for errors that are little
053     * more than wrappers for other throwables.
054     * 
055     * @param cause The cause (which is saved for later retrieval by the
056     * {@code Throwable.getCause()} method).  (A null value is permitted, and indicates that the
057     * cause is nonexistent or unknown.)
058     */
059    public ArrayExpectedError(Throwable cause)
060    { super(); initCause(cause); }
061}