treebolic.model
Class Tree

java.lang.Object
  extended by treebolic.model.Tree

public class Tree
extends java.lang.Object

Model

Author:
Bernard Bou

Field Summary
private  java.util.List<IEdge> theEdges
          Edge list
private  INode theRoot
          Root node
 
Constructor Summary
Tree(INode thisRoot, java.util.List<IEdge> theseEdges)
          Constructor
 
Method Summary
 INode findNodeAt(INode thisStart, Complex thisLocation)
          Find node nearest to location
 INode findNodeById(INode thisStart, java.lang.String thisId)
          Find node by id
 java.util.List<IEdge> getEdges()
          Get edges
 INode getRoot()
          Get root node
 void setEdges(java.util.List<IEdge> theseEdges)
          Set edges
 void setRoot(INode thisRoot)
          Set root node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theRoot

private INode theRoot
Root node


theEdges

private java.util.List<IEdge> theEdges
Edge list

Constructor Detail

Tree

public Tree(INode thisRoot,
            java.util.List<IEdge> theseEdges)
Constructor

Parameters:
thisRoot - root node
theseEdges - edge list
Method Detail

getRoot

public INode getRoot()
Get root node

Returns:
root node

getEdges

public java.util.List<IEdge> getEdges()
Get edges

Returns:
edges

setRoot

public void setRoot(INode thisRoot)
Set root node

Parameters:
thisRoot - node

setEdges

public void setEdges(java.util.List<IEdge> theseEdges)
Set edges

Parameters:
theseEdges - edge list

findNodeAt

public INode findNodeAt(INode thisStart,
                        Complex thisLocation)
Find node nearest to location

Parameters:
thisStart - start node (only descendants are considered)
thisLocation - unit circle location
Returns:
node if found, null otherwise

findNodeById

public INode findNodeById(INode thisStart,
                          java.lang.String thisId)
Find node by id

Parameters:
thisStart - start node
thisId - target id
Returns:
node if found, null otherwise