package com.srbenoit.sparsearray;

/**
 * An exception thrown by sparse arrays when invalid operations are attempted.
 */
public final class SparseArrayException extends RuntimeException {

    /** version number for serialization */
    private static final long serialVersionUID = -3949534910942884478L;

    /**
     * Constructs a new <code>SparseArrayException</code> with <code>null</code> as its detail
     * message.
     */
    public SparseArrayException() {

        super();
    }

    /**
     * Constructs a new <code>SparseArrayException</code> with the specified detail message.
     *
     * @param  message  the detail message
     */
    public SparseArrayException(final String message) {

        super(message);
    }

    /**
     * Constructs a new <code>SparseArrayException</code> with the specified detail message and
     * cause.
     *
     * <p>Note that the detail message associated with <code>cause</code> is <i>not</i>
     * automatically incorporated in this runtime exception's detail message.
     *
     * @param  message  the detail message
     * @param  cause    the cause
     */
    public SparseArrayException(final String message, final Throwable cause) {

        super(message, cause);
    }

    /**
     * Constructs a new <code>SparseArrayException</code> with the specified cause and a detail
     * message of <code>(cause==null ? null : cause.toString())</code> (which typically contains the
     * class and detail message of <code>cause</code> ).
     *
     * @param  cause  the cause
     */
    public SparseArrayException(final Throwable cause) {

        super(cause);
    }
}
