nan.model
Class MessageTree

java.lang.Object
  extended bynan.model.MessageTree
All Implemented Interfaces:
Transposer

public class MessageTree
extends java.lang.Object
implements Transposer

A tree for Messages.

Version:
1.8, 1/2/04
Author:
John David Ratliff

Constructor Summary
MessageTree()
          Creates a new MessageTree object.
 
Method Summary
 void addChild(Message message)
          Adds a child to this tree just under the root.
 void addChild(MessageHeader header)
          Adds a child to this tree just under the root.
 void addThreadChild(MessageHeader header, java.util.StringTokenizer references)
          Adds a thread child in the proper sequence to this tree.
 void addThreadChild(Message message, java.util.StringTokenizer references)
          Adds a thread child in the proper sequence to this tree.
 javax.swing.tree.TreeNode getRoot()
          Gets the root of this Tree.
 java.util.Enumeration preorderTraversal()
          Returns an enumeration containing all the children in a pre-order traversal pattern.
 java.lang.String toString()
          Returns a String representation of this MessageTree.
 void transpose(java.lang.Object object)
          Transposes (copies over) the values of another object of the same type onto this one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageTree

public MessageTree()
Creates a new MessageTree object.

Method Detail

getRoot

public javax.swing.tree.TreeNode getRoot()
Gets the root of this Tree. Useful in components like JTree.

Returns:
The TreeNode root.

preorderTraversal

public java.util.Enumeration preorderTraversal()
Returns an enumeration containing all the children in a pre-order traversal pattern.

Returns:
The child Enumeration.

addChild

public void addChild(Message message)
Adds a child to this tree just under the root.

Parameters:
message - The Message to encapsulate.

addChild

public void addChild(MessageHeader header)
Adds a child to this tree just under the root.

Parameters:
header - The MessageHeader to encapsulate.

addThreadChild

public void addThreadChild(Message message,
                           java.util.StringTokenizer references)
Adds a thread child in the proper sequence to this tree.

Parameters:
message - The Message to add.
references - The path to the correct thread position.

addThreadChild

public void addThreadChild(MessageHeader header,
                           java.util.StringTokenizer references)
Adds a thread child in the proper sequence to this tree.

Parameters:
header - The MessageHeader to add.
references - The path to the correct thread position.

transpose

public void transpose(java.lang.Object object)
Transposes (copies over) the values of another object of the same type onto this one. If the object is not the same type as the invoked object, it will be ignored.

Specified by:
transpose in interface Transposer
Parameters:
object - The object to transpose over this one.

toString

public java.lang.String toString()
Returns a String representation of this MessageTree.

Returns:
A String representation.