001package Torello.HTML; 002 003import java.util.Comparator; 004import java.io.Serializable; 005 006/** 007 * This is a simple data-class whose primary reason for development was to provide a way for the 008 * NodeSearch Package classes to simultaneously return both a {@link TagNode} instance, and a 009 * {@code Vector}-index location (for that node) - <I>at the same time</I> - when searching HTML 010 * web-pages for HTML tags. 011 * 012 * <BR /><BR /> 013 * <EMBED CLASS='external-html' DATA-FILE-ID=TAG_NODE_INDEX> 014 * <!-- <EMBED CLASS='external-html' DATA-FILE-ID=NODE_INDEX> --> 015 * <EMBED CLASS='external-html' DATA-FILE-ID=IMPLEMENTS_REPLACE> 016 * 017 * @see TagNode 018 * @see NodeIndex 019 * @see Torello.HTML.NodeSearch.TagNodePeek 020 * @see Torello.HTML.NodeSearch.InnerTagPeek 021 */ 022public class TagNodeIndex 023 extends NodeIndex<TagNode> 024 implements CharSequence, Serializable, Cloneable 025{ 026 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 027 public static final long serialVersionUID = 1; 028 029 /** 030 * Constructor for this class. 031 * @param index This is the index of vectorized-page that contains {@code tagNode} 032 * @param tagNode This is the {@link TagNode} being stored in this data-structure. 033 * @throws IndexOutOfBoundsException if {@code index} is negative, this exception is thrown. 034 * @throws NullPointerException if {@code tagNode} is null. 035 */ 036 public TagNodeIndex(int index, TagNode tagNode) 037 { super(index, tagNode); } 038 039 /** 040 * Java's {@code interface Cloneable} requirements. This instantiates a new 041 * {@code TagNodeIndex} with identical {@code TagNode n} and {@code int index} fields. 042 * @return A new {@code TagNodeIndex} whose internal fields are identical to this one. 043 */ 044 public TagNodeIndex clone() { return new TagNodeIndex(this.index, this.n); } 045}