de.uni_tuebingen.sfb.lichtenstein.binarytrees
Class BinaryTree

java.lang.Object
  extended by de.uni_tuebingen.sfb.lichtenstein.binarytrees.BinaryTree
All Implemented Interfaces:
Serializable

public class BinaryTree
extends Object
implements Serializable

Binary trees are the trees to which sentences will be converted and which will be the input for automata to check. There are node labels, but no edge labels. Binary trees are built bottom-up: first construct leaves, and add those to new nodes.

Author:
Hendrik Maryns
See Also:
Serialized Form
Invariant:
The root may not be null. | root != null

Nested Class Summary
static class BinaryTree.BinaryNode
          A node in a binary tree.
 
Constructor Summary
BinaryTree(BinaryTree.BinaryNode root, String id, String sentence)
          Initialize a new BinaryTree, taking the given node as root.
 
Method Summary
 String getId()
          Get the id of the linguistic tree this binary tree derives from.
 BinaryTree.BinaryNode getRoot()
          Get the root of this tree.
 String getSentence()
          Get the sentence this tree represents.
 String toString()
          Get a string representation of this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryTree

public BinaryTree(BinaryTree.BinaryNode root,
                  String id,
                  String sentence)
Initialize a new BinaryTree, taking the given node as root.

Parameters:
root - The node to serve as root.
id - The id of the tree.
sentence - The sentence this tree is associated with.
Postconditions:
  • The given node is the root. | new.getRoot() == root
  • The given id is the id. | new.getId() == id
  • The given sentence is the sentence. | new.getSentence() == sentence
  • Method Detail

    getRoot

    public BinaryTree.BinaryNode getRoot()
    Get the root of this tree.

    Returns:
    The root.

    getId

    public String getId()
    Get the id of the linguistic tree this binary tree derives from.

    Returns:
    The id.

    getSentence

    public String getSentence()
    Get the sentence this tree represents.

    Returns:
    The sentence.

    toString

    public String toString()
    Get a string representation of this node. Prints the root.

    Overrides:
    toString in class Object


    © Copyright 2008 Hendrik Maryns   Creative Commons License