]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Arrays utility
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 10 Nov 2011 15:41:18 +0000 (15:41 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:17 +0000 (11:22 +0200)
git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@23239 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.interop/src/org/simantics/interop/utils/Arrays.java [new file with mode: 0644]

diff --git a/org.simantics.interop/src/org/simantics/interop/utils/Arrays.java b/org.simantics.interop/src/org/simantics/interop/utils/Arrays.java
new file mode 100644 (file)
index 0000000..c455115
--- /dev/null
@@ -0,0 +1,27 @@
+package org.simantics.interop.utils;\r
+\r
+import java.util.Collection;\r
+\r
+/**\r
+ * TODO : merge to os.utils.datastructures.\r
+ * \r
+ * @author Marko Luukkainen <marko.luukkainen@vtt.fi>\r
+ *\r
+ */\r
+public class Arrays {\r
+       \r
+       public static <T> boolean containsAll(Collection<T> coll, T[] arr) {\r
+               for (T t : arr) {\r
+                       if (!coll.contains(t))\r
+                               return false;\r
+               }\r
+               return true;\r
+       }\r
+       \r
+       public static <T> void addAll(Collection<T> coll, T[] arr) {\r
+               for (T t : arr) {\r
+                       coll.add(t);\r
+               }\r
+       }\r
+\r
+}\r