de.aitools.ir.retrievalmodels.representation.suffixtree
Class SuffixTreeNode

java.lang.Object
  extended by de.aitools.ir.retrievalmodels.representation.suffixtree.SuffixTreeNode

public class SuffixTreeNode
extends java.lang.Object

This class represents the nodes of any suffix tree instance. Every nodes contains several information about its incoming edge, the suffixes it represents and its children.

Version:
$Id: SuffixTreeNode.java,v 1.1 2010/05/19 15:48:58 poma1006 Exp $
Author:
Martin Potthast

Constructor Summary
SuffixTreeNode()
           
 
Method Summary
 void addChild(SuffixTreeNode newNode)
          Adds a childnode to the nodes set of children.
 java.util.List<SuffixTreeNode> getChildren()
          Gets the set of children of this node.
 int getCommonPrefixLength()
          Gets the length of the prefix which is common to all suffixes this node represents.
 java.lang.String getCommonSuffix()
          Gets the common suffix represented by this node.
 java.util.List<java.lang.Integer> getIds()
          Gets the ids of the texts which are represented by this node.
 java.lang.String getIncomingEdgeLabel()
          Gets the label of the incoming edge of this node.
 java.util.List<java.lang.String> getIncomingEdgeWords(java.util.List<java.lang.String> vocabulary)
           
 java.util.List<Suffix> getSuffixes()
          Returns all suffixes this node represents.
 java.util.List<java.lang.String> getTexts()
          Gets the set of texts which are represented by this node.
 boolean isLeaf()
          Returns whether this node is a leaf or not.
 void setCommonPrefixLength(int commonPrefixLength)
          Sets the length of the prefix which is common to all suffixes this node represents.
 void setLeaf(boolean isLeaf)
          Sets whether this node should be a leaf or not.
 void setSuffixes(java.util.List<Suffix> suffixes)
          Sets the suffixes this node should represent in a suffix tree.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuffixTreeNode

public SuffixTreeNode()
Method Detail

setSuffixes

public void setSuffixes(java.util.List<Suffix> suffixes)
Sets the suffixes this node should represent in a suffix tree.

Parameters:
suffixes - A set of suffixes.

addChild

public void addChild(SuffixTreeNode newNode)
Adds a childnode to the nodes set of children.

Parameters:
newNode - A node.

setCommonPrefixLength

public void setCommonPrefixLength(int commonPrefixLength)
Sets the length of the prefix which is common to all suffixes this node represents.

Parameters:
commonPrefixLength - The common prefix length.

getChildren

public java.util.List<SuffixTreeNode> getChildren()
Gets the set of children of this node.

Returns:
A set of nodes.

getCommonPrefixLength

public int getCommonPrefixLength()
Gets the length of the prefix which is common to all suffixes this node represents.

Returns:
The common prefix length.

getSuffixes

public java.util.List<Suffix> getSuffixes()
Returns all suffixes this node represents.

Returns:
A set of suffixes.

isLeaf

public boolean isLeaf()
Returns whether this node is a leaf or not.

Returns:
A flag indicating whether this node is a leaf or not.

setLeaf

public void setLeaf(boolean isLeaf)
Sets whether this node should be a leaf or not.

Parameters:
isLeaf - A flag indicating whether this node should be a leaf or not.

getIncomingEdgeLabel

public java.lang.String getIncomingEdgeLabel()
Gets the label of the incoming edge of this node.

Returns:
The label of the incoming edge of this node.

getIncomingEdgeWords

public java.util.List<java.lang.String> getIncomingEdgeWords(java.util.List<java.lang.String> vocabulary)

getCommonSuffix

public java.lang.String getCommonSuffix()
Gets the common suffix represented by this node.

Returns:
the common suffix as a String

getTexts

public java.util.List<java.lang.String> getTexts()
Gets the set of texts which are represented by this node.

Returns:
A set of texts.

getIds

public java.util.List<java.lang.Integer> getIds()
Gets the ids of the texts which are represented by this node.

Returns:
A list of ids.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()