|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.ui.util.StringMatcher
public class StringMatcher
Nested Class Summary | |
---|---|
static class |
StringMatcher.Position
|
Constructor Summary | |
---|---|
StringMatcher(java.lang.String aPattern,
boolean ignoreCase)
Deprecated. Use StringMatcher(pattern, ignoreCase, ignoreWildCards). |
|
StringMatcher(java.lang.String aPattern,
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 | |
---|---|
StringMatcher.Position |
find(java.lang.String text,
int start,
int end)
Find the first occurrence of the pattern between start end(exclusive). |
boolean |
match(java.lang.String text)
match the given text with the pattern |
boolean |
match(java.lang.String text,
int start,
int end)
Given the starting (inclusive) and the ending (exclusive) poisitions in the text , determine if the given substring matches with aPattern |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringMatcher(java.lang.String aPattern, boolean ignoreCase)
public StringMatcher(java.lang.String aPattern, boolean ignoreCase, boolean ignoreWildCards)
aPattern
- 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 StringMatcher.Position find(java.lang.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(java.lang.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
public boolean match(java.lang.String text)
text
with the pattern
text
- a String object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |