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
37
38
39
40
41
42
43
44
45
package Torello.HTML;

import java.util.Comparator;
import java.io.Serializable;

/**
 * This is a simple data-class whose primary reason for development was to provide a way for the
 * NodeSearch Package classes to simultaneously return both a {@link CommentNode} instance, and a
 * {@code Vector}-index location (for that node) - <I>at the same time</I> - when searching HTML
 * web-pages for HTML comments.
 * 
 * <BR /><BR />
 * <EMBED CLASS="external-html" DATA-FILE-ID=COMMENT_NODE_INDEX>
 * <!-- <EMBED CLASS="external-html" DATA-FILE-ID=NODE_INDEX> -->
 * <EMBED CLASS='external-html' DATA-FILE-ID=IMPLEMENTS_REPLACE>
 * 
 * @see CommentNode
 * @see NodeIndex
 * @see Torello.HTML.NodeSearch.CommentNodePeek
 */
public class CommentNodeIndex
    extends NodeIndex<CommentNode>
    implements CharSequence, Serializable, Cloneable
{
    /** <EMBED CLASS="external-html" DATA-FILE-ID="SVUID"> */
    public static final long serialVersionUID = 1;

    /**
     * Constructor for this class. 
     * @param index This is the index of vectorized-page that contains {@code commentNode}
     * @param commentNode The {@link CommentNode} being stored in this data-structure.
     * @throws IndexOutOfBoundsException if {@code index} is negative, this exception is thrown.
     * @throws NullPointerException if {@code commentNode} is null.
     */
    public CommentNodeIndex(int index, CommentNode commentNode)
    { super(index, commentNode); }

    /**
     * Java's {@code interface Cloneable} requirements.  This instantiates a new
     * {@code CommentNodeIndex} with identical {@code CommentNode n} and {@code int index} fields.
     * 
     * @return A new {@code CommentNodeIndex} whose internal fields are identical to this one.
     */
    public CommentNodeIndex clone() { return new CommentNodeIndex(this.index, this.n); }
}