Last change
on this file since 1107 was
922,
checked in by sherbold, 12 years ago
|
- renaming of packages from de.ugoe.cs.quest to de.ugoe.cs.autoquest
|
-
Property svn:executable set to
*
|
File size:
1.8 KB
|
Line | |
---|
1 | package de.ugoe.cs.autoquest.tasktrees.treeimpl;
|
---|
2 |
|
---|
3 | import java.util.ArrayList;
|
---|
4 | import java.util.List;
|
---|
5 |
|
---|
6 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode;
|
---|
7 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNodeInfo;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * TODO comment
|
---|
11 | *
|
---|
12 | * @version $Revision: $ $Date: $
|
---|
13 | * @author 2011, last modified by $Author: $
|
---|
14 | */
|
---|
15 | public class NodeInfo implements ITaskTreeNodeInfo {
|
---|
16 |
|
---|
17 | /** */
|
---|
18 | private ITaskTreeNode task;
|
---|
19 |
|
---|
20 | /** */
|
---|
21 | private long lastUpdate;
|
---|
22 |
|
---|
23 | /** */
|
---|
24 | private List<ITaskTreeNode> parentNodes = new ArrayList<ITaskTreeNode>();
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * @param node
|
---|
28 | */
|
---|
29 | NodeInfo(ITaskTreeNode task) {
|
---|
30 | this.task = task;
|
---|
31 | lastUpdate = System.currentTimeMillis();
|
---|
32 | }
|
---|
33 |
|
---|
34 | /*
|
---|
35 | * (non-Javadoc)
|
---|
36 | *
|
---|
37 | * @see de.ugoe.cs.tasktree.treeifc.NodeInfo#getTask()
|
---|
38 | */
|
---|
39 | @Override
|
---|
40 | public ITaskTreeNode getTask() {
|
---|
41 | return task;
|
---|
42 | }
|
---|
43 |
|
---|
44 | /*
|
---|
45 | * (non-Javadoc)
|
---|
46 | *
|
---|
47 | * @see de.ugoe.cs.tasktree.treeimpl.NodeInfo#getNoOfOccurencesInTree()
|
---|
48 | */
|
---|
49 | @Override
|
---|
50 | public int getNoOfOccurencesInTree() {
|
---|
51 | return parentNodes.size();
|
---|
52 | }
|
---|
53 |
|
---|
54 | /*
|
---|
55 | * (non-Javadoc)
|
---|
56 | *
|
---|
57 | * @see de.ugoe.cs.tasktree.treeimpl.NodeInfo#getLastUpdate()
|
---|
58 | */
|
---|
59 | @Override
|
---|
60 | public long getLastUpdate() {
|
---|
61 | return lastUpdate;
|
---|
62 | }
|
---|
63 |
|
---|
64 | /**
|
---|
65 | * TODO: comment
|
---|
66 | *
|
---|
67 | */
|
---|
68 | void addParent(ITaskTreeNode parent) {
|
---|
69 | parentNodes.add(parent);
|
---|
70 | }
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * TODO: comment
|
---|
74 | *
|
---|
75 | */
|
---|
76 | void removeParent(ITaskTreeNode parent) {
|
---|
77 | parentNodes.remove(parent);
|
---|
78 | }
|
---|
79 |
|
---|
80 | /*
|
---|
81 | * (non-Javadoc)
|
---|
82 | *
|
---|
83 | * @see java.lang.Object#toString()
|
---|
84 | */
|
---|
85 | @Override
|
---|
86 | public synchronized String toString() {
|
---|
87 | return "NodeInfo(" + task + ", " + parentNodes.size() + " parents)";
|
---|
88 | }
|
---|
89 |
|
---|
90 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.