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

Method getIndex

ij/src/main/java/ij/gui/Overlay.java:120–128  ·  view source on GitHub ↗

Returns the index of the ROI with the specified name, or -1 if not found.

(String name)

Source from the content-addressed store, hash-verified

118
119 /** Returns the index of the ROI with the specified name, or -1 if not found. */
120 public int getIndex(String name) {
121 if (name==null) return -1;
122 Roi[] rois = toArray();
123 for (int i=rois.length-1; i>=0; i--) {
124 if (name.equals(rois[i].getName()))
125 return i;
126 }
127 return -1;
128 }
129
130 /** Returns the index of the last ROI that contains the point (x,y)
131 or null if no ROI contains the point. */

Callers 11

runMethod · 0.95
getMethod · 0.95
extractStringMethod · 0.45
parseIntegerMethod · 0.45
extractCharMethod · 0.45

Calls 3

toArrayMethod · 0.95
getNameMethod · 0.65
equalsMethod · 0.45

Tested by 3