| java.lang.Object org.eclipse.ui.internal.ide.StringMatcher
StringMatcher | public class StringMatcher (Code) | | A string pattern matcher suppporting '*' and '?' wildcards.
|
Inner Class :public static class Position | |
Constructor Summary | |
public | StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) StringMatcher constructor takes in a String object that is a simple
pattern which may contain '*' for 0 and many characters and
'?' for exactly one character. |
Method Summary | |
public StringMatcher.Position | find(String text, int start, int end) Find the first occurrence of the pattern between start end(exclusive). | public boolean | match(String text) | public boolean | match(String text, int start, int end) | protected int | posIn(String text, int start, int end) | protected int | regExpPosIn(String text, int start, int end, String p) | protected boolean | regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) | protected int | textPosIn(String text, int start, int end, String p) |
fBound | protected int fBound(Code) | | |
fHasLeadingStar | protected boolean fHasLeadingStar(Code) | | |
fHasTrailingStar | protected boolean fHasTrailingStar(Code) | | |
fIgnoreCase | protected boolean fIgnoreCase(Code) | | |
fIgnoreWildCards | protected boolean fIgnoreWildCards(Code) | | |
fLength | protected int fLength(Code) | | |
fSingleWildCard | final protected static char fSingleWildCard(Code) | | |
StringMatcher | public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards)(Code) | | StringMatcher constructor takes in a String object that is a simple
pattern which may contain '*' for 0 and many characters and
'?' for exactly one character.
Literal '*' and '*' characters must be escaped in the pattern
e.g. "\*" means literal "*", etc.
Escaping any other character (including the escape character itself),
just results in that character in the pattern.
e.g. "\a" means "a" and "\\" means "\"
If invoking the StringMatcher with string literals in Java, don't forget
escape characters are represented by "\\".
Parameters: pattern - the pattern to match text against Parameters: ignoreCase - if true, case is ignored Parameters: ignoreWildCards - if true, wild cards and their escape sequences are ignored(everything is taken literally). |
find | public StringMatcher.Position find(String text, int start, int end)(Code) | | Find the first occurrence of the pattern between start end(exclusive).
Parameters: text - the String object to search in Parameters: start - the starting index of the search range, inclusive Parameters: end - the ending index of the search range, exclusive an StringMatcher.Position object that keeps the starting (inclusive) and ending positions (exclusive) of the first occurrence of the pattern in the specified range of the text; return null if not found or subtextis empty (start==end). A pair of zeros is returned if pattern is empty stringNote that for pattern like "*abc*" with leading and trailing stars, position of "abc"is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned |
match | public boolean match(String text)(Code) | | match the given text with the pattern
true if matched eitherwise false Parameters: text - a String object |
match | public boolean match(String text, int start, int end)(Code) | | Given the starting (inclusive) and the ending (exclusive) positions in the
text , determine if the given substring matches with aPattern
true if the specified portion of the text matches the pattern Parameters: text - a String object that contains the substring to match Parameters: start - marks the starting position (inclusive) of the substring Parameters: end - marks the ending index (exclusive) of the substring |
posIn | protected int posIn(String text, int start, int end)(Code) | | Parameters: text - a string which contains no wildcard Parameters: start - the starting index in the text for search, inclusive Parameters: end - the stopping point of search, exclusive the starting index in the text of the pattern , or -1 if not found |
regExpPosIn | protected int regExpPosIn(String text, int start, int end, String p)(Code) | | Parameters: text - a simple regular expression that may only contain '?'(s) Parameters: start - the starting index in the text for search, inclusive Parameters: end - the stopping point of search, exclusive Parameters: p - a simple regular expression that may contains '?' the starting index in the text of the pattern , or -1 if not found |
regExpRegionMatches | protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen)(Code) | | boolean Parameters: text - a String to match Parameters: tStart - int that indicates the starting index of match, inclusive Parameters: p - String, String, a simple regular expression that may contain '?' Parameters: pStart - Parameters: plen - |
textPosIn | protected int textPosIn(String text, int start, int end, String p)(Code) | | Parameters: text - the string to match Parameters: start - the starting index in the text for search, inclusive Parameters: end - the stopping point of search, exclusive Parameters: p - a string that has no wildcard the starting index in the text of the pattern , or -1 if not found |
|
|