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

Method split

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

Source from the content-addressed store, hash-verified

1640 }
1641
1642 Variable[] split() {
1643 String s1 = getFirstString();
1644 String s2 = null;
1645 if (interp.nextToken()==')')
1646 interp.getRightParen();
1647 else
1648 s2 = getLastString();
1649 if (s1==null)
1650 return null;
1651 String[] strings = null;
1652 if (s1.length()>0 && s2!=null && (s2.equals(",")||s2.equals(";")))
1653 strings = s1.split(s2,-1);
1654 else if (s1.length()>0 && s2!=null && s2.length()>=3 && s2.startsWith("(")&&s2.endsWith(")")) {
1655 s2 = s2.substring(1,s2.length()-1);
1656 strings = s1.split(s2,-1);
1657 } else
1658 strings = (s2==null||s2.equals(""))?Tools.split(s1):Tools.split(s1, s2);
1659 Variable[] array = new Variable[strings.length];
1660 for (int i=0; i<strings.length; i++)
1661 array[i] = new Variable(0, 0.0, strings[i]);
1662 return array;
1663 }
1664
1665 Variable[] getFileList() {
1666 String dir = getStringArg();

Callers 6

getArrayFunctionMethod · 0.95
FunctionFinderMethod · 0.45
showArrayInspectorMethod · 0.45
closeMethod · 0.45
openMethod · 0.45
getTableTypeMethod · 0.45

Calls 9

getFirstStringMethod · 0.95
getLastStringMethod · 0.95
splitMethod · 0.95
getRightParenMethod · 0.80
startsWithMethod · 0.80
substringMethod · 0.80
lengthMethod · 0.65
nextTokenMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected