Last change
on this file since 1043 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
|
Rev | Line | |
---|
[922] | 1 | package de.ugoe.cs.autoquest.tasktrees.treeimpl;
|
---|
[439] | 2 |
|
---|
| 3 | import java.util.ArrayList;
|
---|
| 4 | import java.util.List;
|
---|
| 5 |
|
---|
[922] | 6 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode;
|
---|
| 7 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNodeInfo;
|
---|
[439] | 8 |
|
---|
| 9 | /**
|
---|
| 10 | * TODO comment
|
---|
[557] | 11 | *
|
---|
[439] | 12 | * @version $Revision: $ $Date: $
|
---|
[557] | 13 | * @author 2011, last modified by $Author: $
|
---|
[439] | 14 | */
|
---|
[557] | 15 | public class NodeInfo implements ITaskTreeNodeInfo {
|
---|
| 16 |
|
---|
| 17 | /** */
|
---|
| 18 | private ITaskTreeNode task;
|
---|
[439] | 19 |
|
---|
[557] | 20 | /** */
|
---|
| 21 | private long lastUpdate;
|
---|
[439] | 22 |
|
---|
[557] | 23 | /** */
|
---|
| 24 | private List<ITaskTreeNode> parentNodes = new ArrayList<ITaskTreeNode>();
|
---|
[439] | 25 |
|
---|
[557] | 26 | /**
|
---|
| 27 | * @param node
|
---|
| 28 | */
|
---|
| 29 | NodeInfo(ITaskTreeNode task) {
|
---|
| 30 | this.task = task;
|
---|
| 31 | lastUpdate = System.currentTimeMillis();
|
---|
| 32 | }
|
---|
[439] | 33 |
|
---|
[557] | 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 | }
|
---|
[439] | 43 |
|
---|
[557] | 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 | }
|
---|
[439] | 53 |
|
---|
[557] | 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 | }
|
---|
[439] | 63 |
|
---|
[557] | 64 | /**
|
---|
| 65 | * TODO: comment
|
---|
| 66 | *
|
---|
| 67 | */
|
---|
| 68 | void addParent(ITaskTreeNode parent) {
|
---|
| 69 | parentNodes.add(parent);
|
---|
| 70 | }
|
---|
[439] | 71 |
|
---|
[557] | 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 |
|
---|
[439] | 90 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.