diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-19 03:38:05 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-19 03:38:05 +0000 |
| commit | 500b15abeb493bc40b77b964aba1eb0186d79b9e (patch) | |
| tree | 0ac24f853288d5274406cfd3a72c81f8fd5ce52a /sources/core/VSTaskManager.java | |
| parent | 88f7efd0ccc386db4672750eca227af40db04a13 (diff) | |
TaskManager improvements.
Diffstat (limited to 'sources/core/VSTaskManager.java')
| -rw-r--r-- | sources/core/VSTaskManager.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index 4f79d16..1857865 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -216,6 +216,7 @@ public class VSTaskManager { return false; } + /* public synchronized LinkedList<VSTask> getProtocolTasks(VSProtocol protocol) { LinkedList<VSTask> protocolTasks = new LinkedList<VSTask>(); @@ -277,6 +278,34 @@ public class VSTaskManager { insert(task); } } +*/ + public synchronized VSPriorityQueue<VSTask> getLocalTasks() { + VSPriorityQueue<VSTask> processTasks = new VSPriorityQueue<VSTask>(); + + for (VSTask task : fullfilledProgrammedTasks) + if (!task.isGlobalTimed() && task.isProgrammed()) + processTasks.add(task); + + for (VSTask task : tasks) + if (task.isProgrammed()) + processTasks.add(task); + + return processTasks; + } + + public synchronized VSPriorityQueue<VSTask> getGlobalTasks() { + VSPriorityQueue<VSTask> processTasks = new VSPriorityQueue<VSTask>(); + + for (VSTask task : fullfilledProgrammedTasks) + if (task.isGlobalTimed() && task.isProgrammed()) + processTasks.add(task); + + for (VSTask task : globalTasks) + if (task.isProgrammed()) + processTasks.add(task); + + return processTasks; + } public synchronized VSPriorityQueue<VSTask> getProcessLocalTasks(VSProcess process) { VSPriorityQueue<VSTask> processTasks = new VSPriorityQueue<VSTask>(); |
