MCPcopy Create free account
hub / github.com/antlr/codebuff / countIn

Method countIn

corpus/java/training/guava/base/CharMatcher.java:677–685  ·  view source on GitHub ↗

Returns the number of matching characters found in a character sequence.

(CharSequence sequence)

Source from the content-addressed store, hash-verified

675 * Returns the number of matching characters found in a character sequence.
676 */
677 public int countIn(CharSequence sequence) {
678 int count = 0;
679 for (int i = 0; i < sequence.length(); i++) {
680 if (matches(sequence.charAt(i))) {
681 count++;
682 }
683 }
684 return count;
685 }
686
687 /**
688 * Returns a string containing all non-matching characters of a character sequence, in order. For

Callers 1

countInMethod · 0.45

Calls 2

matchesMethod · 0.95
lengthMethod · 0.45

Tested by

no test coverage detected