CTL.Types
Class Tree<T>

java.lang.Object
  extended by CTL.Types.Tree<T>
All Implemented Interfaces:
Writable, TemplHack

public class Tree<T>
extends java.lang.Object
implements Writable, TemplHack

CTL implementation of a simple tree


Field Summary
private  Sibling root
          Root node of the tree
private  TypeTree type
          Type parameter for the data the siblings store
 
Constructor Summary
Tree(java.lang.Object data)
          Generate a new Tree
 
Method Summary
 boolean equals(java.lang.Object moo)
          Check if this object is equal to another one
 void read(SerialIn in)
          Serial read function
 Sibling root()
          Retrieve this tree's root node
 void setTypes(TypeTree[] types)
          Template hack implementation
 Sibling sibl(java.lang.Object data)
          Search for a certain node
 java.lang.String toString()
          Retrieve a string representation of this object
 void write(SerialOut out)
          Serial write function
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

root

private Sibling root
Root node of the tree


type

private TypeTree type
Type parameter for the data the siblings store

Constructor Detail

Tree

public Tree(java.lang.Object data)
     throws CTLException,
            java.lang.ClassNotFoundException
Generate a new Tree

Parameters:
data - Data associated to the root node
Throws:
CTLException
java.lang.ClassNotFoundException
Method Detail

setTypes

public void setTypes(TypeTree[] types)
Template hack implementation

Specified by:
setTypes in interface TemplHack
Parameters:
types - Type parameters

root

public Sibling root()
Retrieve this tree's root node

Returns:
Root node

sibl

public Sibling sibl(java.lang.Object data)
             throws CTLException
Search for a certain node

Parameters:
data - Data to search for
Returns:
Node which holds the data or null if none found
Throws:
CTLException

toString

public java.lang.String toString()
Retrieve a string representation of this object

Overrides:
toString in class java.lang.Object
Returns:
String

equals

public boolean equals(java.lang.Object moo)
Check if this object is equal to another one

Overrides:
equals in class java.lang.Object
Parameters:
moo - Object to compare to
Returns:
True if equals, false if not

read

public void read(SerialIn in)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException,
                 java.lang.InstantiationException,
                 java.lang.IllegalAccessException,
                 java.lang.reflect.InvocationTargetException
Serial read function

Specified by:
read in interface Writable
Parameters:
in - Input stream
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

write

public void write(SerialOut out)
           throws java.io.IOException,
                  java.lang.IllegalAccessException,
                  java.lang.reflect.InvocationTargetException,
                  CTLException
Serial write function

Specified by:
write in interface Writable
Parameters:
out - Output stream
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
CTLException