source: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/NodeInfo.java @ 1074

Last change on this file since 1074 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
RevLine 
[922]1package de.ugoe.cs.autoquest.tasktrees.treeimpl;
[439]2
3import java.util.ArrayList;
4import java.util.List;
5
[922]6import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode;
7import 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]15public 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.