001package Torello.HTML.Tools.NewsSite;
002
003/**
004 * Thrown by the <CODE><B>'ScrapedArticleReceiver'</B></CODE> interface, if any of the methods
005 * inside an implementation of interface <CODE>'ScrapedArticleReceiver'</CODE> need to throw an
006 * exception - then that exception <B>must be wraped</B> by this  <I>(unchecked, runtime)</I>
007 * exception.
008 * 
009 * <BR /><BR />
010 * <EMBED CLASS='external-html' DATA-FILE-ID=RECEIVE_EX>
011 * <EMBED CLASS='external-html' DATA-FILE-ID=EXPM>
012 */
013public class ReceiveException extends java.io.IOException
014{
015    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX> */
016    public static final long serialVersionUID = 1;
017
018    /**
019     * This is the News Web-Site "Section" that was being processed when this
020     * {@code ReceiveException} was thrown.
021     */
022    public final int sectionURLNum;
023
024    /**
025     * This is the {@code Vector}-index into the News Web-Site "Newspaper Article" {@code Vector}
026     * for the {@code Article} that was being processed by  {@code ScrapedArticleReceiver} when the 
027     * {@code ReceiveException} was thrown.
028     */
029    public final int articleNum;
030
031    /**
032     * Constructs a new exception with the specified detail message, and two {@code public, final}
033     * integer parameters: {@code sectionURLNum} and {@code articleNum}.
034     * 
035     * @param message the detail message.
036     * 
037     * @param sectionURLNum This is a {@code Vector}-index pointer.  It points to the News-Website
038     * 'Section {@code URL}' that was provided to the {@code class ScrapeURL's get(...)} method.
039     * Since the output/return {@code Vector} to that class is <B>parallel</B> to the input
040     * {@code Vector<URL> sectionURLs}, this integer also (identically) points to the output
041     * {@code return-Vector} location that holds the News-Paper Section that was being processed
042     * when this {@code ReceiveException} was thrown.
043     * 
044     * @param articleNum This is also a {@code Vector}-index pointer.  It points to the particular
045     * {@code Article} whose processing ultimately resulted in {@code ReceiveException} being
046     * thrown.  The {@code Vector} to which this index points <I>may or may not be obvious - <B>but
047     * it is the {@code return-Vector} produced by the {@code class ScrapeURLs' get(...)} 
048     * method.</I></B>
049     * 
050     * @see #sectionURLNum
051     * @see #articleNum
052     */
053    public ReceiveException(String message, int sectionURLNum, int articleNum)
054    {
055        super(message);
056
057        this.sectionURLNum  = sectionURLNum;
058        this.articleNum     = articleNum;
059    }
060
061    /**
062     * Constructs a new exception with the specified detail message, cause-chain throwable, and two 
063     * {@code public, final} integer parameters: {@code sectionURLNum} and {@code articleNum}.
064     * 
065     * @param message The detail message (which is saved for later retrieval by the
066     * {@code Throwable.getMessage()} method).
067     * 
068     * @param cause the cause (which is saved for later retrieval by the
069     * {@code Throwable.getCause()} method).  (A null value is permitted, and indicates that the
070     * cause is nonexistent or unknown.)
071     * 
072     * @param sectionURLNum This is a {@code Vector}-index pointer.  It points to the News-Website
073     * 'Section {@code URL}' that was provided to the {@code class ScrapeURL's get(...)} method.
074     * Since the output/return {@code Vector} to that class is <B>parallel</B> to the input
075     * {@code Vector<URL> sectionURLs}, this integer also (identically) points to the output
076     * {@code return-Vector} location that holds the News-Paper Section that was being processed
077     * when this {@code ReceiveException} was thrown.
078     * 
079     * @param articleNum This is a {@code Vector}-index pointer.  It points to the particular
080     * {@code Article} whose processing ultimately resulted in {@code ReceiveException} being
081     * thrown.  The {@code Vector} to which this index points <I>may or may not be obvious - <B>but
082     * it is the {@code return-Vector} produced by the {@code class ScrapeURLs' get(...)} 
083     * method.</I></B>
084     * 
085     * @see #sectionURLNum
086     * @see #articleNum
087     */
088    public ReceiveException(String message, Throwable cause, int sectionURLNum, int articleNum)
089    {
090        super(message, cause);
091
092        this.sectionURLNum  = sectionURLNum;
093        this.articleNum     = articleNum;
094    }
095}