@Test public void testMatch() { WildCardMatcher m = new WildCardMatcher("wild?ard", true); assertEquals(LineMatcher.MATCHED, m.match("wildcard")); assertEquals(LineMatcher.MATCHED, m.match("wildward")); assertEquals(LineMatcher.MATCHED, m.match("wilddard")); assertEquals(LineMatcher.MATCHED, m.match("wild?ard")); assertEquals(LineMatcher.NOT_MATCHED, m.match("wildard")); assertEquals(LineMatcher.NOT_MATCHED, m.match("wildcarde")); assertEquals(LineMatcher.NOT_MATCHED, m.match("awildcard")); assertEquals(LineMatcher.NOT_MATCHED, m.match("wildddard")); assertEquals(LineMatcher.NOT_MATCHED, m.match("mildcard")); assertEquals(LineMatcher.NOT_MATCHED, m.match("wildc?rd")); m = new WildCardMatcher("wild*ard", true); assertEquals(LineMatcher.MATCHED, m.match("wildcard")); assertEquals(LineMatcher.MATCHED, m.match("wildward")); assertEquals(LineMatcher.MATCHED, m.match("wilddard")); assertEquals(LineMatcher.MATCHED, m.match("wildard")); assertEquals(LineMatcher.MATCHED, m.match("wildxyzard")); assertEquals(LineMatcher.MATCHED, m.match("wildxyzard")); assertEquals(LineMatcher.NOT_MATCHED, m.match("wild")); assertEquals(LineMatcher.NOT_MATCHED, m.match("ard")); assertEquals(LineMatcher.NOT_MATCHED, m.match("wildcat")); assertEquals(LineMatcher.NOT_MATCHED, m.match("wildcarda")); assertEquals(LineMatcher.NOT_MATCHED, m.match("mildcard")); }
@Override public int match(String token) { String tokenToMatch = normalizeString(token); return wildcardEquals(pattern, 0, tokenToMatch, 0) ? MATCHED : NOT_MATCHED; }
WildCardMatcher extends LineMatcher { @Override public int match(String token) { String tokenToMatch = normalizeString(token); return wildcardEquals(pattern, 0, tokenToMatch, 0) ? MATCHED : NOT_MATCHED; } }
WildCardMatcher extends LineMatcher { @Override public int match(String token) { String tokenToMatch = normalizeString(token); return wildcardEquals(pattern, 0, tokenToMatch, 0) ? MATCHED : NOT_MATCHED; } WildCardMatcher(String pattern, boolean caseInsensitive); }
WildCardMatcher extends LineMatcher { @Override public int match(String token) { String tokenToMatch = normalizeString(token); return wildcardEquals(pattern, 0, tokenToMatch, 0) ? MATCHED : NOT_MATCHED; } WildCardMatcher(String pattern, boolean caseInsensitive); @Override int match(String token); static boolean wildcardEquals(String pattern, int patternIdx,
            String string, int stringIdx); }
WildCardMatcher extends LineMatcher { @Override public int match(String token) { String tokenToMatch = normalizeString(token); return wildcardEquals(pattern, 0, tokenToMatch, 0) ? MATCHED : NOT_MATCHED; } WildCardMatcher(String pattern, boolean caseInsensitive); @Override int match(String token); static boolean wildcardEquals(String pattern, int patternIdx,
            String string, int stringIdx); static final char WILDCARD_STRING; static final char WILDCARD_CHAR; }