Package de.rwth.swc.coffee4j.engine.util
Class ArrayUtil
- java.lang.Object
-
- de.rwth.swc.coffee4j.engine.util.ArrayUtil
-
public final class ArrayUtil extends java.lang.ObjectCommon operations which need to be performed on arrays in combinatorial test input generation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontains(int[] elements, int element)Checks whether the given element appears anywhere in the given array.static int[]exclude(int[] elements, int[] excludedElements)Calculates an array with the same order and elements as the original, except the excluded ones.
-
-
-
Method Detail
-
exclude
public static int[] exclude(int[] elements, int[] excludedElements)Calculates an array with the same order and elements as the original, except the excluded ones. For example, if elements is [0, 5, 3, 2, 5, 2], and excluded elements is [5, 6], then [0, 3, 2, 2] is the result.- Parameters:
elements- all elements. Must not benullexcludedElements- the ones which are be excluded (duplicates don't matter). Most not benull- Returns:
- all elements exception the ones which shall be excluded
-
contains
public static boolean contains(int[] elements, int element)Checks whether the given element appears anywhere in the given array. If the given array is empty, the element cannot appear in it and thereforenullis returned.- Parameters:
elements- all elements which are searched. Must not benullelement- the element for which is searched- Returns:
- whether the given element appears in the given elements at any arbitrary index
-
-