List of utility methods to do Array Find
boolean | findAll(int[] arr1, int[] arr2) find All for (int a1 : arr1) { if (!find(a1, arr2)) { return false; return true; |
List | findAllArgumentPermutations(Object[][] allArguments) Permute all possible parameters return findAllArgumentPermutations(allArguments, 0, 0, new Object[allArguments.length], new ArrayList<Object[]>()); |
List | findAllOrientations(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; |
int | getIndex(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); ... |
int | getIndex(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; |
int | getIndexObject(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; |
ArrayList | getIndexOf(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); ... |