summaryrefslogtreecommitdiff
path: root/sources/core
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-06-11 10:19:41 +0000
committerPaul Buetow <paul@buetow.org>2008-06-11 10:19:41 +0000
commit371b00f2c8bd3944d636e81ed0cb422b3d011ee3 (patch)
treeaf022c18655a63ffbbbc9d5edf78eb58d13f0de2 /sources/core
parent0e2e70d5a393024f3ae4a3a3560b4df51075000a (diff)
serialization works?!
Diffstat (limited to 'sources/core')
-rw-r--r--sources/core/VSTaskManager.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java
index 471b54f..a435401 100644
--- a/sources/core/VSTaskManager.java
+++ b/sources/core/VSTaskManager.java
@@ -508,14 +508,14 @@ public class VSTaskManager implements VSSerializable {
ArrayList<VSTask> serializeThoseTasks = new ArrayList<VSTask>();
for (VSTask task : fullfilledProgrammedTasks) {
- if (!task.hasNotSerializableEvent())
- serializeThoseTasks.add(task);
- }
+ if (!task.hasNotSerializableEvent())
+ serializeThoseTasks.add(task);
+ }
for (VSTask task : globalTasks) {
- if (!task.hasNotSerializableEvent())
- serializeThoseTasks.add(task);
- }
+ if (!task.hasNotSerializableEvent())
+ serializeThoseTasks.add(task);
+ }
ArrayList<VSProcess> processes = simulatorCanvas.getProcesses();
@@ -523,16 +523,16 @@ public class VSTaskManager implements VSSerializable {
for (VSProcess process : processes) {
VSPriorityQueue<VSTask> localTasks = process.getTasks();
for (VSTask task : localTasks) {
- if (!task.hasNotSerializableEvent())
- serializeThoseTasks.add(task);
- }
+ if (!task.hasNotSerializableEvent())
+ serializeThoseTasks.add(task);
+ }
}
}
objectOutputStream.writeObject(
- new Integer(serializeThoseTasks.size()));
+ new Integer(serializeThoseTasks.size()));
for (VSTask task : serializeThoseTasks)
- task.serialize(serialize, objectOutputStream);
+ task.serialize(serialize, objectOutputStream);
/** For later backwards compatibility, to add more stuff */
objectOutputStream.writeObject(new Boolean(false));
@@ -561,6 +561,10 @@ public class VSTaskManager implements VSSerializable {
}
int numTasks = ((Integer) objectInputStream.readObject()).intValue();
+
+ if (VSSerialize.DEBUG)
+ System.out.println("Num of tasks: " + numTasks);
+
for (int i = 0; i < numTasks; ++i) {
VSTask task = new VSTask(serialize, objectInputStream);
addTask(task, task.isProgrammed());