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

Method getArray

ij/src/main/java/ij/macro/Functions.java:730–763  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

728 }
729
730 Variable[] getArray() {
731 interp.getToken();
732 if (interp.token==VARIABLE_FUNCTION && pgm.table[interp.tokenAddress].type==TABLE) {
733 Variable v = getVariableFunction(TABLE);
734 if (v!=null) {
735 Variable[] a = v.getArray();
736 if (a!=null) return a;
737 }
738 }
739 boolean newArray = interp.token==ARRAY_FUNCTION && pgm.table[interp.tokenAddress].type==NEW_ARRAY;
740 boolean arrayFunction = interp.token==ARRAY_FUNCTION;
741 if (!(interp.token==WORD||newArray||arrayFunction))
742 interp.error("Array expected");
743 Variable[] a = null;
744 if (newArray)
745 a = getArrayFunction(NEW_ARRAY);
746 else if (arrayFunction)
747 a = getArrayFunction(pgm.table[interp.tokenAddress].type);
748 else {
749 Variable v = interp.lookupVariable();
750 a = v.getArray();
751 int size = v.getArraySize();
752 if (a!=null && a.length!=size) {
753 Variable[] a2 = new Variable[size];
754 for (int i=0; i<size; i++)
755 a2[i] = a[i];
756 v.setArray(a2);
757 a = v.getArray();
758 }
759 }
760 if (a==null)
761 interp.error("Array expected");
762 return a;
763 }
764
765 private Color getColor() {
766 String color = getString();

Callers 15

getNumericArrayMethod · 0.95
getStringArrayMethod · 0.95
doPlotMethod · 0.95
joinMethod · 0.95
applyMacroToArrayMethod · 0.95
filterArrayMethod · 0.95
deleteArrayIndexMethod · 0.95
deleteArrayValueMethod · 0.95
fourierArrayMethod · 0.95
printArrayMethod · 0.95
concatArrayMethod · 0.95
sliceArrayMethod · 0.95

Calls 8

getVariableFunctionMethod · 0.95
getArrayMethod · 0.95
getArrayFunctionMethod · 0.95
getArraySizeMethod · 0.95
setArrayMethod · 0.95
lookupVariableMethod · 0.80
getTokenMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected