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

Method anyOf

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

Returns a char matcher that matches any character present in the given character sequence.

(final CharSequence sequence)

Source from the content-addressed store, hash-verified

391 * sequence.
392 */
393 public static CharMatcher anyOf(final CharSequence sequence) {
394 switch (sequence.length()) {
395 case 0:
396 return none();
397 case 1:
398 return is(sequence.charAt(0));
399 case 2:
400 return isEither(sequence.charAt(0), sequence.charAt(1));
401 default:
402 // TODO(lowasser): is it potentially worth just going ahead and building a precomputed
403 // matcher?
404 return new AnyOf(sequence);
405 }
406 }
407
408 /**
409 * Returns a {@code char} matcher that matches any character not present in the given character

Callers 4

SeparatedBaseEncodingMethod · 0.95
noneOfMethod · 0.95
MediaTypeClass · 0.95
InternetDomainNameClass · 0.95

Calls 4

noneMethod · 0.95
isMethod · 0.95
isEitherMethod · 0.95
lengthMethod · 0.45

Tested by

no test coverage detected