1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | package Torello.HTML; /** * A function-pointer definition that facilitates the substituting of {@code HTMLNode} elements in * Vectorized-HTML with other, user-provided, elements. * * <EMBED CLASS='external-html' DATA-FILE-ID=REPLACE_FUNCTION> */ @FunctionalInterface public interface ReplaceFunction extends java.io.Serializable { /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDFI> */ public static final long serialVersionUID = 1; /** * The intention here is to provide a "replace node" for a particular position in the * original-{@code Vector<HTMLNode>} * * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH> * * @param n This is the "old node" that needs replacing. It will have been obtained * from the original HTML page {@code Vector}. * * @param curVecPos The position in the original {@code Vector}. This value may be * ignored, but is provided as a matter of convenience. * * @param iterationCount The for-loop that will be making calls to * {@code 'getReplacement(...)'} provides the a loop-count to this method. All that means * is there is a "loop variable" that is updated-by-one (incremented) each time this method is * called. * * @return A new node to be substituted for the current node at the position identified by * {code 'curArrPos'}. */ public HTMLNode getReplacement(HTMLNode n, int curVecPos, int iterationCount); } |