Package org.apache.webbeans.util
Class ArrayUtil
java.lang.Object
org.apache.webbeans.util.ArrayUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Set<T>asSet(T... items) static booleanequalsIgnorePosition(Object[] arr1, Object[] arr2) Compare two arrays regardless of the position of the elements in the arrays.
-
Method Details
-
equalsIgnorePosition
Compare two arrays regardless of the position of the elements in the arrays. The complex handling with temporary flags is necessary due to the possibility of having multiple occurrences of the same element in the arrays. In this case both arrays have to contain the exactly same amount of those elements. This is only suited for smaller arrays (e.g. count < 100) since the algorithm uses a product of both arrays. If one likes to use this for larger arrays, we'd have to use hashes.- Parameters:
arr1-arr2-- Returns:
-
asSet
-