forgot to upload a new file for Scheduling Simulator
authorjzhou <jzhou>
Mon, 19 May 2008 22:46:49 +0000 (22:46 +0000)
committerjzhou <jzhou>
Mon, 19 May 2008 22:46:49 +0000 (22:46 +0000)
Robust/src/Analysis/Scheduling/ObjectInfo.java [new file with mode: 0644]

diff --git a/Robust/src/Analysis/Scheduling/ObjectInfo.java b/Robust/src/Analysis/Scheduling/ObjectInfo.java
new file mode 100644 (file)
index 0000000..d4a4a2c
--- /dev/null
@@ -0,0 +1,32 @@
+package Analysis.Scheduling;
+
+import Analysis.TaskStateAnalysis.FlagState;
+
+public class ObjectInfo {
+    public ObjectSimulator obj;
+    public FlagState fs;
+    public int version;
+
+    public ObjectInfo(ObjectSimulator obj) {
+       this.obj = obj;
+       this.fs = obj.getCurrentFS();
+       this.version = obj.getVersion();
+    }
+
+    public boolean equals(Object o) {
+       if (o instanceof ObjectInfo) {
+           ObjectInfo oi=(ObjectInfo)o;
+           if ((oi.obj != obj) || 
+                   (oi.fs != fs) ||
+                   (oi.version != version)) {
+               return false;
+           }
+           return true;
+       }
+       return false;
+    }
+
+    public int hashCode() {
+       return obj.hashCode()^fs.hashCode()^version;
+    }
+}
\ No newline at end of file