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

Method anyOf

output/java_guava/1.4.19/CharMatcher.java:440–453  ·  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

438
439
440 public static CharMatcher anyOf(final CharSequence sequence) {
441 switch (sequence.length()) {
442 case 0:
443 return none();
444 case 1:
445 return is(sequence.charAt(0));
446 case 2:
447 return isEither(sequence.charAt(0), sequence.charAt(1));
448 default:
449 // TODO(lowasser): is it potentially worth just going ahead and building a precomputed
450 // matcher?
451 return new AnyOf(sequence);
452 }
453 }
454
455 /**
456 * Returns a {@code char} matcher that matches any character not present in the given character

Callers 4

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

Calls 4

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

Tested by

no test coverage detected