|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.services.clientserver.search.SystemNonRegexMatcher
public class SystemNonRegexMatcher
A string pattern matcher, suppporting * and ? wildcards.
Nested Class Summary | |
---|---|
static class |
SystemNonRegexMatcher.Position
|
Field Summary | |
---|---|
protected int |
fBound
|
protected boolean |
fHasLeadingStar
|
protected boolean |
fHasTrailingStar
|
protected boolean |
fIgnoreCase
|
protected boolean |
fIgnoreWildCards
|
protected int |
fLength
|
protected String |
fPattern
|
protected String[] |
fSegments
|
protected static char |
fSingleWildCard
|
Constructor Summary | |
---|---|
SystemNonRegexMatcher(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 '?' |
Method Summary | |
---|---|
SystemNonRegexMatcher.Position |
find(String text,
int start,
int end)
Find the first occurrence of the pattern between start end(exclusive). |
boolean |
match(String text)
match the given text with the pattern |
boolean |
match(String text,
int start,
int end)
Given the starting (inclusive) and the ending (exclusive) positions in the text , determine if the given substring matches with aPattern |
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String fPattern
protected int fLength
protected boolean fIgnoreWildCards
protected boolean fIgnoreCase
protected boolean fHasLeadingStar
protected boolean fHasTrailingStar
protected String[] fSegments
protected int fBound
protected static final char fSingleWildCard
Constructor Detail |
---|
public SystemNonRegexMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards)
pattern
- the pattern to match text againstignoreCase
- if true, case is ignoredignoreWildCards
- if true, wild cards and their escape sequences are ignored
(everything is taken literally).Method Detail |
---|
public SystemNonRegexMatcher.Position find(String text, int start, int end)
start
end(exclusive).
text
- the String object to search instart
- the starting index of the search range, inclusiveend
- the ending index of the search range, exclusive
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 subtext
is empty (start==end). A pair of zeros is returned if pattern is empty string
Note 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 returnedpublic boolean match(String text)
text
with the pattern
text
- a String object
public boolean match(String text, int start, int end)
text
, determine if the given substring matches with aPattern
text
- a String object that contains the substring to matchstart
- marks the starting position (inclusive) of the substringend
- marks the ending index (exclusive) of the substring
protected int posIn(String text, int start, int end)
text
- a string which contains no wildcardstart
- the starting index in the text for search, inclusiveend
- the stopping point of search, exclusive
protected int regExpPosIn(String text, int start, int end, String p)
text
- a simple regular expression that may only contain '?'(s)start
- the starting index in the text for search, inclusiveend
- the stopping point of search, exclusivep
- a simple regular expression that may contains '?'caseIgnored
- wether the pattern is not casesensitive
protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen)
text
- a String to matchstart
- int that indicates the starting index of match, inclusiveend
- int that indicates the ending index of match, exclusivep
- a simple regular expression that may contain '?'ignoreCase
- boolean indicating wether p
is case sensitive
protected int textPosIn(String text, int start, int end, String p)
text
- the string to matchstart
- the starting index in the text for search, inclusiveend
- the stopping point of search, exclusivep
- a string that has no wildcardignoreCase
- boolean indicating wether p
is case sensitive
|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |