/**
 * WordIndex.java
 *
 * File Revision Date: 04/20/04
 */

package lab12;

import lab07.Queue;

import lab09.BinaryTree;
import lab09.Node;

/**
 * This subclass of labtrees.BinaryTree stores
 * a single {@link IndexItem} in each tree node. It features
 * an insert() method that accepts a new {@link IndexItem}
 * containing a word found in a textfile scan, as well as
 * the line number where the word was found.
 */
public class WordIndex extends BinaryTree {

    /** This method is invoked by the
     * {@link DisplayFrame#buildIndex} method of the main
     * {@link DisplayFrame} application for each word it finds while
     * scanning a textfile. The application sends this method()
     * a new {@link IndexItem} containing the word
     * and the number of the line where this occurrence of the word
     * was found in the text. If this is the first occurrence
     * of this word, a new leaf node is created to store this new
     * {@link IndexItem} as its data. However, if the word has already
     * been found in the text, the item containing that word is updated
     * in two ways. First, the occurrence count for the word must be
     * incremented. Second, the line number must be extracted from
     * the "new" {@link IndexItem} parameter and then added to the queue
     * of line numbers in the existing {@link IndexItem}.
     * <P>
     * @param item The {@link IndexItem} containing the word and its
     * associated line number.
     */
    public void insert (IndexItem item) {
	// STUB -- FILL IN
    }
}
