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

Method filterArray

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

Source from the content-addressed store, hash-verified

6326 }
6327
6328 Variable[] filterArray() {
6329 ArrayList list = new ArrayList();
6330 interp.getLeftParen();
6331 Variable[] a1 = getArray();
6332 String filter = getLastString();
6333 for (int i=0; i<a1.length; i++) {
6334 String str = a1[i].getString();
6335 boolean contains = false;
6336 if (str!=null) {
6337 if (filter.startsWith("(") && filter.endsWith(")"))
6338 contains = FolderOpener.containsRegex(str, filter, false);
6339 else
6340 contains = str.contains(filter);
6341 if (contains)
6342 list.add(a1[i]);
6343 }
6344 }
6345 return (Variable[])list.toArray(new Variable[list.size()]);
6346 }
6347
6348 Variable[] deleteArrayIndex() {
6349 interp.getLeftParen();

Callers 1

doArrayMethod · 0.95

Calls 10

getArrayMethod · 0.95
getLastStringMethod · 0.95
containsRegexMethod · 0.95
getLeftParenMethod · 0.80
startsWithMethod · 0.80
addMethod · 0.65
getStringMethod · 0.45
containsMethod · 0.45
toArrayMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected