bug fixes
[debian/openrocket] / src / net / sf / openrocket / util / Utils.java
index 39b3e861f9ea221b58374646488ae9539e45c041..93d320ef2b5e4ad0f694b4d3855ef828dd4f7f5b 100644 (file)
@@ -17,4 +17,21 @@ public class Utils {
                }
        }
        
+       
+       /**
+        * Check whether an array contains a specified object.
+        * 
+        * @param array         the array to search
+        * @param search        the object to search for
+        * @return                      whether the object was in the array
+        */
+       public static boolean contains(Object[] array, Object search) {
+               for (Object o : array) {
+                       if (equals(o, search)) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+       
 }