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 * <BR /><BR /><DIV CLASS=JDHint> 066 * <B STYLE='color:red;'>Note:</B> The detail message associated with cause is not 067 * automatically incorporated into this exception's detail message. 068 * </DIV> 069 * 070 * @param message The detail message (which is saved for later retrieval by the 071 * {@code Throwable.getMessage()} method). 072 * 073 * @param cause the cause (which is saved for later retrieval by the 074 * {@code Throwable.getCause()} method). (A null value is permitted, and indicates that the 075 * cause is nonexistent or unknown.) 076 * 077 * @param sectionURLNum This is a {@code Vector}-index pointer. It points to the News-Website 078 * 'Section {@code URL}' that was provided to the {@code class ScrapeURL's get(...)} method. 079 * Since the output/return {@code Vector} to that class is <B>parallel</B> to the input 080 * {@code Vector<URL> sectionURLs}, this integer also (identically) points to the output 081 * {@code return-Vector} location that holds the News-Paper Section that was being processed 082 * when this {@code ReceiveException} was thrown. 083 * 084 * @param articleNum This is a {@code Vector}-index pointer. It points to the particular 085 * {@code Article} whose processing ultimately resulted in {@code ReceiveException} being 086 * thrown. The {@code Vector} to which this index points <I>may or may not be obvious - <B>but 087 * it is the {@code return-Vector} produced by the {@code class ScrapeURLs' get(...)} 088 * method.</I></B> 089 * 090 * @see #sectionURLNum 091 * @see #articleNum 092 */ 093 public ReceiveException(String message, Throwable cause, int sectionURLNum, int articleNum) 094 { 095 super(message, cause); 096 097 this.sectionURLNum = sectionURLNum; 098 this.articleNum = articleNum; 099 } 100}