de.fhdarmstadt.fbi.dtree.model
Class DTree

java.lang.Object
  extended byde.fhdarmstadt.fbi.dtree.model.DTree

public class DTree
extends java.lang.Object

A decision tree implementation.

The tree itself contains no logic to evaluate data, this task is left to the Evaluator implementation. It merely enacpsulates the alphabet and the root node for this alphabet.

The Tree is a unbalanced binary tree.

See Also:
DTreeNode, Alphabet

Constructor Summary
DTree(Alphabet alphabet)
          Creates a new decision tree for the given alphabet.
 
Method Summary
 Alphabet getAlphabet()
          Returns the alphabet for this tree.
 DTreeNode getRoot()
          Returns the root node for the tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTree

public DTree(Alphabet alphabet)
Creates a new decision tree for the given alphabet. The alphabet is made immutable before it gets used.

Parameters:
alphabet - the alphabet, never null
Throws:
java.lang.NullPointerException - if the given alphabet is null.
java.lang.IllegalArgumentException - if the given alphabet is empty.
Method Detail

getAlphabet

public Alphabet getAlphabet()
Returns the alphabet for this tree. It is guaranteed, that the alphabet is always valid.

Returns:
the alphabet, never null.

getRoot

public DTreeNode getRoot()
Returns the root node for the tree.

Returns:
the root node.