edu.ucla.belief.dtree
Class DtreeNodeInternal

Object
  extended by DtreeNode
      extended by DtreeNodeInternal

public class DtreeNodeInternal
extends DtreeNode

This class represents Internal DtreeNode objects.

Author:
David Allen

Constructor Summary
DtreeNodeInternal(DtreeNode left, DtreeNode right)
          Creates a DtreeNodeInternal using the two parameters as children.
 
Method Summary
 int getHeight()
          This height is calculated by how many levels of nodes there are, not by how many edges there are between them.
 Collection getLargestCluster(int largest)
          Returns the largest cluster (actually the first it finds which is at least as big as the parameter largest).
 int getNumberInternalNodes()
          Returns the number of internal nodes including (possibly) this one and all below it.
 int getNumberLeafNodes()
          Returns the number of leaf nodes including (possibly) this one and all below it.
 int getNumberNodes()
          Returns the number of DtreeNodes including this one and all below it.
 boolean isLeaf()
           
 DtreeNode left()
           
 DtreeNode right()
           
 String toString()
           
 void writeToParenFile(Writer out)
           
 
Methods inherited from class DtreeNode
containsVar, getCluster, getContext, getCutset, getVars, hashCodeSpecial
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DtreeNodeInternal

public DtreeNodeInternal(DtreeNode left,
                         DtreeNode right)
Creates a DtreeNodeInternal using the two parameters as children.

Parameters:
left - A non-Null DtreeNode.
right - A non-Null DtreeNode.
Throws:
IllegalArgumentException - if left.equals( right)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in class DtreeNode

left

public DtreeNode left()

right

public DtreeNode right()

getNumberNodes

public int getNumberNodes()
Description copied from class: DtreeNode
Returns the number of DtreeNodes including this one and all below it.

Overrides:
getNumberNodes in class DtreeNode

getNumberInternalNodes

public int getNumberInternalNodes()
Description copied from class: DtreeNode
Returns the number of internal nodes including (possibly) this one and all below it.

Specified by:
getNumberInternalNodes in class DtreeNode

getNumberLeafNodes

public int getNumberLeafNodes()
Description copied from class: DtreeNode
Returns the number of leaf nodes including (possibly) this one and all below it.

Specified by:
getNumberLeafNodes in class DtreeNode

getLargestCluster

public Collection getLargestCluster(int largest)
Description copied from class: DtreeNode
Returns the largest cluster (actually the first it finds which is at least as big as the parameter largest).

Specified by:
getLargestCluster in class DtreeNode

getHeight

public int getHeight()
Description copied from class: DtreeNode
This height is calculated by how many levels of nodes there are, not by how many edges there are between them. (e.g. leaf nodes have height of 1, their parents have a height of 2...)

Specified by:
getHeight in class DtreeNode

writeToParenFile

public void writeToParenFile(Writer out)
                      throws IOException
Throws:
IOException
Since:
121302


Copyright 2010 UCLA Automated Reasoning Group