001package Torello.HTML.Tools.NewsSite;
002
003import Torello.HTML.HTMLNode;
004
005import java.util.Vector;
006import java.net.URL;
007
008/**
009 * A simple Java function-pointer / lambda-target that may be used to modify or alter 
010 * Vectorized-HTML, in any way that the programmer has deemed necessary.
011 * 
012 * <EMBED CLASS='external-html' DATA-FILE-ID=HTML_MODIFIER>
013 */
014@FunctionalInterface
015public interface HTMLModifier
016{
017    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDFI> */
018    public static final long serialVersionUID = 1;
019
020    /**
021     * <EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH>
022     *
023     * @param html This is the vectorized-{@code HTML} news-article
024     *
025     * @param originalPageURL This is the original {@code URL} from whence the page was 
026     * downloaded.  It is provided to this method, merely for convenience.
027     * 
028     * @param sectionNum Each article that is downloaded belonged to a particular news
029     * section.  News sections are listed by their position in a Java {@code Vector},
030     * and the index into ths {@code Vector} is treated as a the {@code 'ID'}, or the
031     * {@code 'number'} of the section.
032     * 
033     * <BR /><BR />This value is provided here to this method just for convenience.  When 
034     * {@code '.html'} files are saved (as {@code '.dat'} files) - their save location is 
035     * of the form of {@code 'directoryName/fileName.dat'} - where the {@code String 
036     * 'directoryName'} is this Section Number provided here.
037     * 
038     * @param articleNum Each article that is downloaded is given a number that is merely the
039     * order of the {@code Article} in the download process.  The 5th {@code Article} to be
040     * downloaded in a given / particular section would have filename {@code '005.dat'}.
041     * 
042     * <BR /><BR />This value is provided here to this method just for convenience.
043     */
044    public void modifyOrRetrieve
045        (Vector<HTMLNode> html, URL originalPageURL, int sectionNum, int articleNum);
046}