Java Utililty Methods Array Find

List of utility methods to do Array Find

Description

The list of methods to do Array Find are organized into topic(s).

Method

booleanfindAll(int[] arr1, int[] arr2)
find All
for (int a1 : arr1) {
    if (!find(a1, arr2)) {
        return false;
return true;
ListfindAllArgumentPermutations(Object[][] allArguments)
Permute all possible parameters
return findAllArgumentPermutations(allArguments, 0, 0, new Object[allArguments.length],
        new ArrayList<Object[]>());
ListfindAllOrientations(int[][] matrix)
find all orientations of any matrix or piece provided
List<int[][]> allPossibleRotations = new ArrayList<>();
allPossibleRotations.add(matrix);
allPossibleRotations.add(flipInPlace(matrix));
allPossibleRotations.add(mirror(matrix[0].length, matrix.length, matrix));
allPossibleRotations.addAll(findAllPossibleRightRotations(allPossibleRotations.get(0)));
allPossibleRotations.addAll(findAllPossibleRightRotations(allPossibleRotations.get(2)));
return allPossibleRotations;
intgetIndex(double income, String[] scopes)
get Index
int len = scopes.length;
len++;
double[] vals = new double[len];
vals[0] = income;
for (int i = 1; i < len; i++) {
    vals[i] = Long.parseLong(scopes[i - 1]);
Arrays.sort(vals);
...
intgetIndex(String[] array, String value)
get Index
if (array == null)
    throw new RuntimeException("Can't do index. Collection is Null");
for (int i = 0; i < array.length; i++)
    if (array[i].equals(value))
        return i;
return -1;
intgetIndexObject(Object[] data, Object object)
Find the index of an element in an array.
int x = new ArrayList<>(Arrays.asList(data)).indexOf(object);
if (x == -1) {
    throw new NoSuchElementException("StringUtils : index lookup in array failed for object " + object
            + ". Data length is " + data.length);
return x;
ArrayListgetIndexOf(int i, int[] array)
get Index Of
if (isEmpty(array)) {
    return null;
ArrayList<Integer> result = new ArrayList<Integer>();
for (int index = 0; index < array.length; index++) {
    int num = array[index];
    if (i == num) {
        result.add(index);
...