public class SchedulingTree
extends java.lang.Object
Constructor and Description |
---|
SchedulingTree()
A default Tree
|
SchedulingTree(TreeComponent root)
A tree is being constructed from a given XML file
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(TreeComponent child,
TreeComponent parent)
Add a new Scheduling Component to the tree
|
void |
addTask(TreeComponent parent,
Task task)
Add the task into the given Scheduling Component
|
void |
convertToXML(java.lang.String fileName)
Write the entire tree to the given XML file
|
java.util.HashMap<java.lang.String,TreeComponent> |
getMap()
Returns all the components in the Tree
|
TreeComponent |
getRoot()
Returns the Root Component of the Tree
|
void |
removeComponent(TreeComponent parent,
TreeComponent child)
Remove a given Scheduling Component from the tree
|
public SchedulingTree()
public SchedulingTree(TreeComponent root)
root
- Root Componentpublic java.util.HashMap<java.lang.String,TreeComponent> getMap()
public void addComponent(TreeComponent child, TreeComponent parent)
child
- A new child Scheduling Componentparent
- The parent to which the child needs to be addedjava.lang.Exception
- When Min and Max periods for parent are different, then child
needs to have same values for them as the parent. If this
rule is not followed, Exception will be thrown.public void removeComponent(TreeComponent parent, TreeComponent child)
parent
- Parent of the child which is to be removedchild
- Component to be removedpublic void addTask(TreeComponent parent, Task task)
parent
- Scheduling Component to which the new task needs to be addedtask
- public TreeComponent getRoot()
public void convertToXML(java.lang.String fileName)
fileName
- Pathname of the file to which the Scheduling Tree needs to be
written