cc.mallet.grmm.types
Class Tree

java.lang.Object
  extended by cc.mallet.grmm.types.Tree
Direct Known Subclasses:
JunctionTree

public class Tree
extends java.lang.Object

Class for arbitrary trees, based on implementation in OpenJGraph. The OpenJGraph tree implementation is a bit minimal wrt convenience functions, so we add a few here. Created: Wed Oct 1 14:51:47 2003

Version:
$Id: Tree.java,v 1.1 2007/10/22 21:37:44 mccallum Exp $
Author:
Charles Sutton

Constructor Summary
Tree()
           
 
Method Summary
 void add(java.lang.Object rt)
           
 void addNode(java.lang.Object parent, java.lang.Object child)
           
 boolean containsObject(java.lang.Object v)
           
 java.lang.String dumpToString()
           
 java.util.List getChildren(java.lang.Object parent)
           
 java.lang.Object getParent(java.lang.Object child)
           
 java.lang.Object getRoot()
           
 java.util.Iterator getVerticesIterator()
           
 boolean isLeaf(java.lang.Object v)
           
 boolean isRoot(java.lang.Object var)
           
protected  int lookupIndex(java.lang.Object v)
           
protected  java.lang.Object lookupVertex(int idx)
           
static Tree makeFromSubtree(java.lang.Object parent, java.util.List subtrees)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tree

public Tree()
Method Detail

makeFromSubtree

public static Tree makeFromSubtree(java.lang.Object parent,
                                   java.util.List subtrees)

lookupIndex

protected int lookupIndex(java.lang.Object v)

lookupVertex

protected java.lang.Object lookupVertex(int idx)

add

public void add(java.lang.Object rt)

addNode

public void addNode(java.lang.Object parent,
                    java.lang.Object child)

getParent

public java.lang.Object getParent(java.lang.Object child)

getChildren

public java.util.List getChildren(java.lang.Object parent)

isRoot

public boolean isRoot(java.lang.Object var)

containsObject

public boolean containsObject(java.lang.Object v)

isLeaf

public boolean isLeaf(java.lang.Object v)

getVerticesIterator

public java.util.Iterator getVerticesIterator()

getRoot

public java.lang.Object getRoot()

dumpToString

public java.lang.String dumpToString()