From: adash Date: Tue, 3 Mar 2009 10:15:28 +0000 (+0000) Subject: added some more class support X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6668a1d4308d1bbd6f2ed3ea5f7e855a72b6cc68;p=IRC.git added some more class support bug fix for prefetch analysis --- diff --git a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java index 3e06eb5d..b7f9c6a2 100644 --- a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java +++ b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java @@ -112,6 +112,7 @@ public class PrefetchAnalysis { case FKind.FlatNew: case FKind.FlatCastNode: case FKind.FlatTagDeclaration: + case FKind.FlatInstanceOfNode: processDefaultCase(curr,child_prefetch_set_copy); break; diff --git a/Robust/src/ClassLibrary/Math.java b/Robust/src/ClassLibrary/Math.java index 95cfcc96..6f16dee7 100644 --- a/Robust/src/ClassLibrary/Math.java +++ b/Robust/src/ClassLibrary/Math.java @@ -11,6 +11,14 @@ public class Math { return PI; } + public static int abs(int x) { + if (x < 0) { + return -x; + } else { + return x; + } + } + public static double fabs(double x) { if (x < 0) { return -x; @@ -43,6 +51,16 @@ public class Math { } } + public static int max(int a, int b) { + if(a == b) + return a; + if(a > b) { + return a; + } else { + return b; + } + } + public static int imax(int a, int b) { if(a == b) return a; diff --git a/Robust/src/ClassLibrary/Vector.java b/Robust/src/ClassLibrary/Vector.java index bd148938..5cd06ca6 100644 --- a/Robust/src/ClassLibrary/Vector.java +++ b/Robust/src/ClassLibrary/Vector.java @@ -100,6 +100,19 @@ public class Vector { array[index] = obj; } + public void remove(Object o) { + int getIndex; + for(int i=0; i=size) { System.printString("Illegal Vector.removeElementAt\n"); @@ -117,4 +130,12 @@ public class Vector { removeElementAt(0); } } + + public boolean contains(Object o) { + for(int i = 0; i < size; i++) { + if(o.equals(array[i])) + return true; + } + return false; + } }