MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / indexOf

Method indexOf

ij/src/main/java/ij/util/Tools.java:153–158  ·  view source on GitHub ↗

Returns the index of the first array element equal to the key, or -1 if no such element. This function can be also used as 'contains' by checking for the return value being >= 0.

(int[] array, int key)

Source from the content-addressed store, hash-verified

151 * the return value being >= 0.
152 */
153 public static int indexOf(int[] array, int key) {
154 for (int i=0; i<array.length; i++)
155 if (array[i] == key)
156 return i;
157 return -1;
158 }
159
160 /** Returns the index of the first array element equal to the key,
161 * or -1 if no such element. If the key is null, returns the index

Callers 15

hasPointPositionMethod · 0.95
ImagePlusMethod · 0.45
getShortTitleMethod · 0.45
getStringPropertyMethod · 0.45
findKeyMethod · 0.45
runUserPlugInMethod · 0.45
showStatusMethod · 0.45
handleLogCommandMethod · 0.45
getValueMethod · 0.45
is64BitMethod · 0.45
setupDialogMethod · 0.45
setAutoThresholdMethod · 0.45

Calls 1

equalsMethod · 0.45

Tested by 5

newColorsMethod · 0.36
newValuesMethod · 0.36
newMinValueMethod · 0.36
newMaxValueMethod · 0.36
newSegmentsMethod · 0.36