|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcalculation.Tree
public class Tree
Class Tree implements the arrival tree for airplanes. It determines tree-shaped path of which the planes follow most of the time when they fly to the airport.
Field Summary | |
---|---|
private TreeNode |
root
The root of a tree. |
private java.util.ArrayList<TreeNode> |
treeMergePoints
Merge points of the tree. |
private java.util.ArrayList<TreeNode> |
treeNodes
Collection of nodes. |
private java.util.ArrayList<Vertex> |
vertexTree
Vertexes of the tree. |
Constructor Summary | |
---|---|
Tree()
Constructor, creates empty array lists for nodes. |
Method Summary | |
---|---|
boolean |
addToTree(java.util.ArrayList<Vertex> path)
Adds given path (list of Vertexes) to the tree. |
java.util.ArrayList<TreeNode> |
getLeaves()
Returns the leaves of a tree (=every node without children). |
TreeNode |
getRoot()
Returns this.root. |
java.util.ArrayList<TreeNode> |
getTree()
Returns this.treeNodes. |
java.util.ArrayList<TreeNode> |
getTreeMergePoints()
Returns merge points of the tree. |
java.util.ArrayList<Vertex> |
getVertexLeaves()
Returns the leaves of a tree (=every node without children) as an ArrayList of Vertexes. |
java.util.ArrayList<Vertex> |
getVertexTree()
Returns this.treeNodes as arrayList of Vertexes. |
void |
setTreeMergePoints(java.util.ArrayList<Vertex> mergePoints)
Sets this.treeMergePoints from parameter. |
java.util.ArrayList<TreeNode> |
treeNodePath(java.util.ArrayList<Vertex> path)
Makes a path containing tree nodes from path containing vertexes by creating new treenodes corresponding to vertexes and adding them, in same order as in parameter path, to a new ArrayList. |
void |
treeToString()
Prints x and y -coordinates of the tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private TreeNode root
private java.util.ArrayList<TreeNode> treeMergePoints
private java.util.ArrayList<TreeNode> treeNodes
private java.util.ArrayList<Vertex> vertexTree
Constructor Detail |
---|
public Tree()
Method Detail |
---|
public boolean addToTree(java.util.ArrayList<Vertex> path)
path
- ArrayList of Vertexes representing the path to be added.
public java.util.ArrayList<TreeNode> getLeaves()
public TreeNode getRoot()
public java.util.ArrayList<TreeNode> getTree()
public java.util.ArrayList<TreeNode> getTreeMergePoints()
public java.util.ArrayList<Vertex> getVertexLeaves()
public java.util.ArrayList<Vertex> getVertexTree()
public void setTreeMergePoints(java.util.ArrayList<Vertex> mergePoints)
mergePoints
- List of all merge points.public java.util.ArrayList<TreeNode> treeNodePath(java.util.ArrayList<Vertex> path)
path
- ArrayList of Vertexes to be made as path of tree nodes.
public void treeToString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |