MCPcopy Create free account
hub / github.com/ReadyTalk/avian / countTokens

Method countTokens

classpath/java/util/StringTokenizer.java:39–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 }
38
39 public int countTokens() {
40 int count = 0;
41 boolean sawNonDelimiter = false;
42 for (int i = position; i < in.length(); ++i) {
43 if (isDelimiter(in.charAt(i))) {
44 if (sawNonDelimiter) {
45 sawNonDelimiter = false;
46 ++ count;
47 }
48
49 if (includeDelimiters) {
50 ++ count;
51 }
52 } else {
53 sawNonDelimiter = true;
54 }
55 }
56
57 if (sawNonDelimiter) {
58 ++ count;
59 }
60
61 return count;
62 }
63
64 public boolean hasMoreTokens() {
65 for (int i = position; i < in.length(); ++i) {

Callers 1

execMethod · 0.95

Calls 3

isDelimiterMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65

Tested by

no test coverage detected