MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getIndex

Method getIndex

src/org/opensourcephysics/tools/DataTool.java:981–991  ·  view source on GitHub ↗

Gets the first array index at which the specified value is found. @param value the value to find @param array the array to search @param ignoreIndex an array index to ignore @return the index, or -1 if not found

(double value, double[] array, int ignoreIndex)

Source from the content-addressed store, hash-verified

979 * @return the index, or -1 if not found
980 */
981 protected static int getIndex(double value, double[] array, int ignoreIndex) {
982 for (int i = 0; i < array.length; i++) {
983 if (i == ignoreIndex) {
984 continue;
985 }
986 if (array[i] == value) {
987 return i;
988 }
989 }
990 return -1;
991 }
992
993 /**
994 * Returns an array of row numbers.

Callers 15

addColumnsMethod · 0.95
initializeAnimationMethod · 0.45
stepIsingModelMethod · 0.45
getIndexOfChildMethod · 0.45
actionPerformedMethod · 0.45
replaceClonesMethod · 0.45
getIndexOfChildMethod · 0.45
loadDataMethod · 0.45
setSelectedDataMethod · 0.45
refreshPlotMethod · 0.45
refreshMeasurementsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected