com.stevesoft.pat
Class Skip
java.lang.Object
|
+--com.stevesoft.pat.Skip
- Direct Known Subclasses:
- Skip2, SkipBMH
- public class Skip
- extends java.lang.Object
This class is used internally to search ahead for some
optimized Regex objects. It searches within a String
for occrences of a given String -- like a more flexible
version of String.indexOf.
- See Also:
Skip2,
SkipBMH
|
Constructor Summary |
Skip(java.lang.String s,
boolean ign,
int o)
Initialize, give it a String to search for, tell it
whether or not to ignoreCase, and what the offset is
of the String within the String to be searched. |
|
Method Summary |
int |
find(StringLike s)
The same as find(s,0,s.length()) |
int |
find(StringLike s,
int start,
int end)
Searches a given region of text beginning at position start
and ending at position end for the skip object. |
static int |
offset(Regex r)
Determine the offset of the String within the pattern
that we are skipping to. |
static java.lang.String |
string(Regex r)
Examine a Regex to determine what String it will
attempt to skip to when searching for patterns. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Skip
public Skip(java.lang.String s,
boolean ign,
int o)
- Initialize, give it a String to search for, tell it
whether or not to ignoreCase, and what the offset is
of the String within the String to be searched.
string
public static java.lang.String string(Regex r)
- Examine a Regex to determine what String it will
attempt to skip to when searching for patterns.
Return -1 if we aren't doing this.
offset
public static int offset(Regex r)
- Determine the offset of the String within the pattern
that we are skipping to. Return -1 if we aren't doing
this.
find
public final int find(StringLike s)
- The same as find(s,0,s.length())
find
public int find(StringLike s,
int start,
int end)
- Searches a given region of text beginning at position start
and ending at position end for the skip object.