001package Torello.HTML; 002 003/** 004 * A function-pointer definition that facilitates the substituting of {@code HTMLNode} elements in 005 * Vectorized-HTML with other, user-provided, elements. 006 * 007 * <EMBED CLASS='external-html' DATA-FILE-ID=REPLACE_FUNCTION> 008 */ 009@FunctionalInterface 010public interface ReplaceFunction extends java.io.Serializable 011{ 012 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDFI> */ 013 public static final long serialVersionUID = 1; 014 015 /** 016 * The intention here is to provide a "replace node" for a particular position in the 017 * original-{@code Vector<HTMLNode>} 018 * 019 * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH> 020 * 021 * @param n This is the "old node" that needs replacing. It will have been obtained 022 * from the original HTML page {@code Vector}. 023 * 024 * @param curVecPos The position in the original {@code Vector}. This value may be 025 * ignored, but is provided as a matter of convenience. 026 * 027 * @param iterationCount The for-loop that will be making calls to 028 * {@code 'getReplacement(...)'} provides the a loop-count to this method. All that means 029 * is there is a "loop variable" that is updated-by-one (incremented) each time this method is 030 * called. 031 * 032 * @return A new node to be substituted for the current node at the position identified by 033 * {code 'curArrPos'}. 034 */ 035 public HTMLNode getReplacement(HTMLNode n, int curVecPos, int iterationCount); 036}