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 TextNode} instance, and a
 * {@code Vector}-index location (for that node) - <I>at the same time</I> - when searching HTML
 * web-pages for document-text.
 * 
 * <BR /><BR />
 * <EMBED CLASS='external-html' DATA-FILE-ID=TEXT_NODE_INDEX>
 * <!-- <EMBED CLASS='external-html' DATA-FILE-ID=NODE_INDEX> -->
 * <EMBED CLASS='external-html' DATA-FILE-ID=IMPLEMENTS_REPLACE>
 * 
 * @see TextNode
 * @see NodeIndex
 * @see Torello.HTML.NodeSearch.TextNodePeek
 */
public class TextNodeIndex 
    extends NodeIndex<TextNode>
    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 textNode}
     * @param textNode This is the {@link TextNode} being stored in this data-structure.
     * @throws IndexOutOfBoundsException if {@code index} is negative, this exception is thrown.
     * @throws NullPointerException if {@code textNode} is null.
     */
    public TextNodeIndex(int index, TextNode textNode)
    { super(index, textNode); }

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