nz.ac.waikato.mcennis.rat.graph
Class Tree

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.model.ModelShell
      extended by nz.ac.waikato.mcennis.rat.graph.MemGraph
          extended by nz.ac.waikato.mcennis.rat.graph.Tree
All Implemented Interfaces:
java.io.Serializable, Graph, Model, ParsedObject

public class Tree
extends MemGraph

Class for describing a tree. Does not enforce acyclic condition. Subclass of MemGraph with MemGraph indexing.

FIXME: Serialization not implemented - needs its own parser and output function.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell
listener
 
Constructor Summary
Tree()
           
 
Method Summary
 void addRoot(Actor a)
          Add a root to the list of roots of this tree (forest)
 java.util.Collection<Actor> getRoots()
          Lists all the roots of this acyclic graph.
 void remove(Actor a)
          Identifies the given user and removes it and all links involving it from the graph.
 
Methods inherited from class nz.ac.waikato.mcennis.rat.graph.MemGraph
add, add, add, add, add, addChild, anonymize, close, commit, escapeXML, getActor, getActor, getActor, getActorCount, getActorIterator, getActorTypes, getChildren, getChildren, getGraphs, getID, getLink, getLink, getLink, getLinkByDestination, getLinkByDestination, getLinkBySource, getLinkBySource, getLinkTypes, getParameters, getParent, getPathSet, getPathSet, getProperty, getProperty, getSubGraph, getSubGraph, init, outputXML, remove, setID, setSubGraph, setWriter
 
Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell
addListener, fireChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model
addListener
 

Constructor Detail

Tree

public Tree()
Method Detail

getRoots

public java.util.Collection<Actor> getRoots()
Lists all the roots of this acyclic graph.

Returns:
roots of the forest

addRoot

public void addRoot(Actor a)
Add a root to the list of roots of this tree (forest)

Parameters:
a - root actor to be added

remove

public void remove(Actor a)
Description copied from interface: Graph
Identifies the given user and removes it and all links involving it from the graph.

Specified by:
remove in interface Graph
Overrides:
remove in class MemGraph
Parameters:
a - user to be removed from the graph.