public class SegmentMatcher extends Object
Constructor and Description |
---|
SegmentMatcher(char[] pattern) |
Modifier and Type | Method and Description |
---|---|
char[] |
getPrefixForBinarySearch()
The pattern used by this matcher is not suitable for binary searches
(e.g.
|
boolean |
match(char[] name)
Matches the given name by prefix and segment matching.
|
static boolean |
match(char[] pattern,
char[] name)
Matches pattern to name by prefix and segment matching.
|
boolean |
matchPrefix(char[] name)
Matches the given name by prefix matching.
|
boolean |
matchRequiredAfterBinarySearch() |
boolean |
matchSegments(char[] name)
Matches the given name by segment matching.
|
public SegmentMatcher(char[] pattern)
pattern
- The camel case or underscore pattern.public boolean match(char[] name)
public boolean matchPrefix(char[] name)
public boolean matchSegments(char[] name)
public static boolean match(char[] pattern, char[] name)
SegmentMatcher
instead
and re-use it all the time, because this is much faster.public char[] getPrefixForBinarySearch()
public boolean matchRequiredAfterBinarySearch()
match(char[])
can be skipped if a
name survived a binary search using the prefix returned by
getPrefixForBinarySearch()
as key.Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.