[439] | 1 | // Module : $RCSfile: ComponentManager.java,v $ |
---|
| 2 | // Version : $Revision: 0.0 $ $Author: patrick $ $Date: 12.02.2012 $ |
---|
| 3 | // Project : TaskTreeCreator |
---|
| 4 | // Creation : 2012 by patrick |
---|
| 5 | // Copyright : Patrick Harms, 2012 |
---|
[557] | 6 | |
---|
[439] | 7 | package de.ugoe.cs.quest.tasktrees.manager; |
---|
| 8 | |
---|
| 9 | import de.ugoe.cs.quest.tasktrees.nodeequality.NodeEqualityRuleManager; |
---|
| 10 | import de.ugoe.cs.quest.tasktrees.temporalrelation.TemporalRelationshipRuleManager; |
---|
[557] | 11 | import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeBuilder; |
---|
| 12 | import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNodeFactory; |
---|
| 13 | import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeBuilder; |
---|
| 14 | import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNodeFactory; |
---|
[439] | 15 | |
---|
| 16 | /** |
---|
| 17 | * TODO comment |
---|
| 18 | * |
---|
| 19 | * @version $Revision: $ $Date: 12.02.2012$ |
---|
| 20 | * @author 2012, last modified by $Author: patrick$ |
---|
| 21 | */ |
---|
[557] | 22 | public class ComponentManager { |
---|
| 23 | |
---|
| 24 | /** */ |
---|
| 25 | private static ComponentManager instance; |
---|
[439] | 26 | |
---|
[557] | 27 | /** */ |
---|
| 28 | private TemporalRelationshipRuleManager temporalRelationshipRuleManager; |
---|
[439] | 29 | |
---|
[557] | 30 | /** */ |
---|
| 31 | private NodeEqualityRuleManager nodeEqualityRuleManager; |
---|
[439] | 32 | |
---|
[557] | 33 | /** */ |
---|
| 34 | private ITaskTreeBuilder taskTreeBuilder; |
---|
[439] | 35 | |
---|
[557] | 36 | /** */ |
---|
| 37 | private ITaskTreeNodeFactory taskTreeNodeFactory; |
---|
[439] | 38 | |
---|
[557] | 39 | /** |
---|
| 40 | * TODO: comment |
---|
| 41 | * |
---|
| 42 | * @return |
---|
| 43 | */ |
---|
| 44 | public static TemporalRelationshipRuleManager getTemporalRelationshipRuleManager() { |
---|
| 45 | return getInstance().temporalRelationshipRuleManager; |
---|
| 46 | } |
---|
[439] | 47 | |
---|
[557] | 48 | /** |
---|
| 49 | * TODO: comment |
---|
| 50 | * |
---|
| 51 | * @return |
---|
| 52 | */ |
---|
| 53 | public static NodeEqualityRuleManager getNodeEqualityRuleManager() { |
---|
| 54 | return getInstance().nodeEqualityRuleManager; |
---|
| 55 | } |
---|
[439] | 56 | |
---|
[557] | 57 | /** |
---|
| 58 | * TODO: comment |
---|
| 59 | * |
---|
| 60 | * @return |
---|
| 61 | */ |
---|
| 62 | public static ITaskTreeBuilder getDefaultTaskTreeBuilder() { |
---|
| 63 | return getInstance().taskTreeBuilder; |
---|
| 64 | } |
---|
[439] | 65 | |
---|
[557] | 66 | /** |
---|
| 67 | * TODO: comment |
---|
| 68 | * |
---|
| 69 | * @return |
---|
| 70 | */ |
---|
| 71 | public static ITaskTreeNodeFactory getDefaultTaskTreeNodeFactory() { |
---|
| 72 | return getInstance().taskTreeNodeFactory; |
---|
| 73 | } |
---|
[439] | 74 | |
---|
[557] | 75 | /** |
---|
| 76 | * TODO: comment |
---|
| 77 | * |
---|
| 78 | * @return |
---|
| 79 | */ |
---|
| 80 | public static synchronized void clearInstance() { |
---|
| 81 | instance = null; |
---|
[439] | 82 | } |
---|
| 83 | |
---|
[557] | 84 | /** |
---|
| 85 | * TODO: comment |
---|
| 86 | * |
---|
| 87 | * @return |
---|
| 88 | */ |
---|
| 89 | private static synchronized ComponentManager getInstance() { |
---|
| 90 | if (instance == null) { |
---|
| 91 | instance = new ComponentManager(); |
---|
| 92 | instance.init(); |
---|
| 93 | } |
---|
| 94 | return instance; |
---|
| 95 | } |
---|
[439] | 96 | |
---|
[557] | 97 | /** |
---|
| 98 | * TODO: comment |
---|
| 99 | * |
---|
| 100 | */ |
---|
| 101 | private void init() { |
---|
| 102 | nodeEqualityRuleManager = new NodeEqualityRuleManager(); |
---|
| 103 | nodeEqualityRuleManager.init(); |
---|
[439] | 104 | |
---|
[557] | 105 | temporalRelationshipRuleManager = |
---|
| 106 | new TemporalRelationshipRuleManager(nodeEqualityRuleManager); |
---|
| 107 | temporalRelationshipRuleManager.init(); |
---|
| 108 | |
---|
| 109 | taskTreeBuilder = new TaskTreeBuilder(); |
---|
| 110 | taskTreeNodeFactory = new TaskTreeNodeFactory(); |
---|
| 111 | } |
---|
| 112 | |
---|
[439] | 113 | } |
---|