From 0e2e70d5a393024f3ae4a3a3560b4df51075000a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 11 Jun 2008 09:48:10 +0000 Subject: More javadoc. Several bugfixes. New feauture: Boolean: sim.periodic A lot of more which i forgot! --- sources/core/VSTask.java | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'sources/core/VSTask.java') diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index c1323e8..9ca04e6 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -99,7 +99,7 @@ public class VSTask implements Comparable, VSSerializable { * Instantiates a new task during a deserialization. * * @param serialize the serialize object - * @param process the object input stream + * @param objectInputStream The input stream */ public VSTask(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { @@ -153,12 +153,30 @@ public class VSTask implements Comparable, VSSerializable { return isProgrammed; } + /** + * Checks if the task is using an "internal event". + * + * @return true, if the task is using an internal event + */ + public boolean hasInternalEvent() { + return event instanceof VSAbstractInternalEvent; + } + + /** + * Checks if the task should not get serialized. + * + * @return true, if the task should not get serialized + */ + public boolean hasNotSerializableEvent() { + return event instanceof VSNotSerializable; + } + /** * Checks if the task is a message receive event. * * @return true, if it is a message receive event */ - public boolean isVSMessageReceiveEvent() { + public boolean hasMessageReceiveEvent() { return event instanceof VSMessageReceiveEvent; } @@ -167,7 +185,7 @@ public class VSTask implements Comparable, VSSerializable { * * @return true, if it is a process recover event */ - public boolean isProcessRecoverEvent() { + public boolean hasProcessRecoverEvent() { return event instanceof VSProcessRecoverEvent; } @@ -366,6 +384,13 @@ public class VSTask implements Comparable, VSSerializable { objectOutputStream.writeObject(new Boolean(false)); objectOutputStream.writeObject(new Integer(process.getProcessNum())); + + if (event.getClassname() == null) + event.init(process); + + if (VSSerialize.DEBUG) + System.out.println("Serializing: " + event.getClassname()); + objectOutputStream.writeObject(event.getClassname()); objectOutputStream.writeObject(new Integer(event.getID())); event.serialize(serialize, objectOutputStream); -- cgit v1.2.3