MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / getTurn

Method getTurn

app/src/main/java/scrambler/Clock.java:207–217  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

205 }
206
207 private int getTurn(String s) {
208 StringBuilder sb = new StringBuilder();
209 for (int i=0; i<s.length(); i++) {
210 char c = s.charAt(i);
211 if (Character.isDigit(c)) sb.append(c);
212 }
213 int turn = Integer.parseInt(sb.toString());
214 if (s.endsWith("-")) return -turn;
215 if (s.endsWith("+")) return turn;
216 return 0;
217 }
218}

Callers 1

imageMethod · 0.95

Calls 2

lengthMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected