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

Method s2ints

ij/src/main/java/ij/plugin/ControlPanel.java:609–619  ·  view source on GitHub ↗

Breaks the specified string into an array of ints. Returns null if there is an error.

(String s)

Source from the content-addressed store, hash-verified

607 /** Breaks the specified string into an array
608 of ints. Returns null if there is an error.*/
609 public int[] s2ints(String s) {
610 StringTokenizer st = new StringTokenizer(s, ", \t");
611 int nInts = st.countTokens();
612 if (nInts==0) return null;
613 int[] ints = new int[nInts];
614 for(int i=0; i<nInts; i++) {
615 try {ints[i] = Integer.parseInt(st.nextToken());}
616 catch (NumberFormatException e) {return null;}
617 }
618 return ints;
619 }
620
621 //boolean isRunning(){return running;}
622

Callers 1

restoreGeometryMethod · 0.95

Calls 2

parseIntMethod · 0.80
nextTokenMethod · 0.45

Tested by

no test coverage detected