Terrier IR Platform
1.1.1

uk.ac.gla.terrier.structures.trees
Class TreeNode

java.lang.Object
  extended by uk.ac.gla.terrier.structures.trees.TreeNode
All Implemented Interfaces:
java.lang.Comparable<TreeNode>
Direct Known Subclasses:
BlockLexiconTreeNode, FieldDocumentTreeNode, TermTreeNode

Deprecated.

public class TreeNode
extends java.lang.Object
implements java.lang.Comparable<TreeNode>

This class represents a node in the binary tree representing either the lexicon, or a document. In the case we are refering to a tree node in the lexicon, then frequency is the document frequency of the term (number of documents that contain the term), while if we refer to the binary tree that represents a document, then frequency refers to the number of occurrences of the term in the document.

Version:
$Revision: 1.23 $
Author:
Gianni Amati, Vassilis Plachouras, Craig Macdonald

Field Summary
 int frequency
          Deprecated. The frequency of the term.
 TreeNode left
          Deprecated. The left child of the node.
 TreeNode right
          Deprecated. The right child of the node.
 java.lang.String term
          Deprecated. The term.
 int termCode
          Deprecated. The term's code.
 
Constructor Summary
TreeNode(java.lang.String newTerm)
          Deprecated. A constructor for a new node.
TreeNode(java.lang.String newTerm, int givenTermCode)
          Deprecated. Constructor for when the the termcode is already known by the calling code
 
Method Summary
 int compareTo(TreeNode TN1)
          Deprecated. Compares the term code of a given tree node with the term code of itself.
 boolean equals(java.lang.Object o)
          Deprecated. Compares the term code of the given tree node with the term code of this node.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

public TreeNode left
Deprecated. 
The left child of the node.


right

public TreeNode right
Deprecated. 
The right child of the node.


frequency

public int frequency
Deprecated. 
The frequency of the term.


term

public java.lang.String term
Deprecated. 
The term.


termCode

public int termCode
Deprecated. 
The term's code.

Constructor Detail

TreeNode

public TreeNode(java.lang.String newTerm)
Deprecated. 
A constructor for a new node. This constructor will obtain a new term code for the term using the TermCodes class.

Parameters:
newTerm - The term that this node is representing.

TreeNode

public TreeNode(java.lang.String newTerm,
                int givenTermCode)
Deprecated. 
Constructor for when the the termcode is already known by the calling code

Parameters:
newTerm - the String term for this term.
givenTermCode - the term code for this string if already known.
Method Detail

compareTo

public int compareTo(TreeNode TN1)
Deprecated. 
Compares the term code of a given tree node with the term code of itself. This method is part of the implementation of the Comparable interface.

Specified by:
compareTo in interface java.lang.Comparable<TreeNode>
Parameters:
TN1 - Object the tree node to compare to.
Returns:
-1, zero, or 1 if the term code of this tree node is less, equal to, or greater than the term code of the given tree node.
Throws:
java.lang.ClassCastException - if the given argument is not an instance of the class TreeNode.

equals

public boolean equals(java.lang.Object o)
               throws java.lang.ClassCastException
Deprecated. 
Compares the term code of the given tree node with the term code of this node.

Overrides:
equals in class java.lang.Object
Parameters:
o - Object the tree node to compare to.
Returns:
true if the given tree node has the same term code as the current one, otherwise it returns false.
Throws:
java.lang.ClassCastException - if the object o is not an instance of the class TreeNode.

Terrier IR Platform
1.1.1

Terrier Information Retrieval Platform 1.1.1. Copyright 2004-2007 University of Glasgow